Showing posts with label developing. Show all posts
Showing posts with label developing. Show all posts

Wednesday, March 28, 2012

PageMethods

Hi,

I ama developing web application using ASP.NET, and I use atlas framework in my app. I have a problem with using PageMethods, I want to return value which came from page to another javascript but I can not,

Normal Page Method usage

function sayHelloFromPage() {

PageMethods.HelloWorld('Mehmet',onComplete);

}

function onComplete(result) {

}

what I wantto make it

functioncallSayHelloFromPage() {

var Result = sayHelloFromPage();

}

function sayHelloFromPage() {

PageMethods.HelloWorld('Mehmet',onComplete);

}

function onComplete(result) {

return result;

}

Hi

PageMethods.HelloWorld('Mehmet',onComplete);

The above call happens asynchronously, which means the call is send to the server and the client does not wait for the call to complete; therefore, you don't see the results immediately instead you have to get the results in the onComplete event, which is fired when the call completes.

Whatever you want to do with the results, e.g. change an HTML element, you have to do it in the onComplete function.

Saturday, March 24, 2012

Paging Problem in Dynamically added GridView

Hi

I am developing a composite control which includes a GridView. GridView is created and bound in CreateChildControls() method. Normally the control works greate. But if I set AllowPaging=True, it gives an "Object null reference exception". Following is the code. Please give me a solution. [N:B: I have added the PageIndexChages Event also].

protected override void CreateChildControls(){_lsAjaxGridView =new GridView();_lsAjaxGridView.ID ="Leadsoft_AjaxGrid";_lsAjaxGridView.AutoGenerateColumns =this.AutoGenerateColumns;foreach (DataControlField dataControlFieldin Columns) _lsAjaxGridView.Columns.Add(dataControlField);if (this.AllowPaging){if (this.PageSize > 0) _lsAjaxGridView.PageSize =this.PageSize; _lsAjaxGridView.AllowPaging =this.AllowPaging; _lsAjaxGridView.PageIndexChanging +=new GridViewPageEventHandler(Leadsoft_AjaxGrid_PageIndexChanged);}_lsAjaxGridView.DataSource = LSDataSourceView;_lsAjaxGridView.DataBind();}
The exception occurs in "_lsAjaxGridView.DataBind();" only when AllowPaging is True.
Exception Message:"Object reference not set to an instance of an object."

Hi this problem is solved. thing is any DataBinding should be done after the control is added to the form.

lsAjaxGridView.DataSource = LSDataSourceView;

Controls.Add(lsAjaxGridView);
_lsAjaxGridView.DataBind();

Wednesday, March 21, 2012

Parser error

I have finished developing my company web site and published it and it works fine, But when they need changes..So I make the changes and published it again, then i have this error raisedOn my local machine when i run the debugger every thing seems to be okBut on internet it generates this error

Server Error in '/' Application.


Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The module was expected to contain an assembly manifest.

Source Error:

Line 1: <%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/ServicesMaster.master" Title=" Global Maintenance Agreements " %>
Line 2: 
Line 3: <%@dotnet.itags.org. Register
Line 4:  Assembly="AjaxControlToolkit"
Line 5:  Namespace="AjaxControlToolkit"


Source File:/Global Maintenance Agreements.aspx Line:3

Assembly Load Trace: The following information can be helpful to determine why the assembly 'AjaxControlToolkit' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 does anybody has a solution?

try to install the ASP AJAX Extension on the IIS

http://asp.net/ajax/downloads/


I already did so from the begginning of the development and it works fine on the local server on my machine


try to reset the iis after installation iisreset from run command line


Please make sure the assembly AjaxControlToolkit.dll is contained in the bin folder of your application.