Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Wednesday, March 28, 2012

Page.ClientScript.RegisterStartupScript in Ajax beta 2

----Code in Module (app_code) folder

Public Sub ShowMessage(ByVal msg As String, ByVal ObjPage As Page)

Try
Dim RegKeyname As String = "infmsg"
If ObjPage.ClientScript.IsStartupScriptRegistered(RegKeyname) Then

RegKeyname = RegKeyname & Now.GetHashCode.ToString("x")
Else
RegKeyname = "infmsg"
End If

ObjPage.ClientScript.RegisterStartupScript(ObjPage.GetType, RegKeyname, String.Format("alert('{0}');", msg), True)


Catch ex As Exception

End Try

End Sub

----------

I used to call this function from any of my asp.net Pages to display an alert message this worked till atlas july ctp now it doenst seem to work in ajax beta 2.

Note : This worked in Normal Pages as well as Pages having an Update panel

Any one any clue ... how to get it back to work

Hi Asifsolkar

I think you should use ScriptManger'sRegisterStartupScript method. There was change between CTP and BETA versions of ASP.NET AJAX ext.

(seehttp://ajax.asp.net/docs/mref/8b90a607-02c9-3c22-6cec-4628c98ccd25.aspx )

Have a nice day

Milo

pagemethod call code sample

Can anyont point me to a code sample where a call is made to a server page method from the client script code?

thanks!

Pratibha

Hi,

please checkthis post from my blog.

PageMethod problem

HI. I have a problem with calling static PageMethod in asp.net ajax.

Problem apperars then i use UrlMappings. For example i have this code in web.config

<urlMappings>
<add url="~/ComputerManager/WorkstationList.aspx" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=1"/>
<add url="~/ComputerManager/ServerList.aspx" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=2"/>
</urlMappings>
and this code in ComputerList.aspx. cs
[WebMethod]
public static string SetSelection(string ID,string dataKey,bool state)
{
...
}

so, when call PageMethods.SetSelection(...) a have a error "The server method SetSelection is failed".

post url ends with WorkstationList.aspx/SetSelection

any ideas?

Hi,

You are rewriting your URL, and these URL are fixed one. They don't cater for any extra items or query string parameters. Thats why they don't map to actual page when you want to do that. In this case I will recommend that you add another entry with following items

<urlMappings><add url="~/ComputerManager/WorkstationList.aspx" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=1"/><add url="~/ComputerManager/ServerList.aspx" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=2"/><add url="~/ComputerManager/WorkstationList.aspx/SetSelection" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=1"/><add url="~/ComputerManager/ServerList.aspx/SetSelection" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=2"/></urlMappings>

Then i use mappings like you suggested, i get a request to pageComputerList.aspx with parametercomp_type=1, insted of calling PageMethod.

So i rewrite it this way

<urlMappings>
<add url="~/ComputerManager/WorkstationList.aspx" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=1"/>
<add url="~/ComputerManager/ServerList.aspx" mappedUrl="~/ComputerManager/ComputerList.aspx?comp_type=2"/>
<add url="~/ComputerManager/WorkstationList.aspx/SetSelection" mappedUrl="~/ComputerManager/ComputerList.aspx/SetSelection"/>
<add url="~/ComputerManager/ServerList.aspx/SetSelection" mappedUrl="~/ComputerManager/ComputerList.aspx/SetSelection"/>
</urlMappings>

and that solves my problem.

Thanks for good idea,ziqbalbh.

PageMethod Code Caching

Hi,

When I change the code of my pagemethod, I have to run IISRESET for the new code to take affect.
If I don't, then the old code is still executed. Building the page or the project doesn't help either.

Any ideas?

Are you sure it's not just caching the js proxy in your browser?

Yes, I'm sure.

I did some more testing. Seems that building the whole project again is actually enough to get the new code to be excuted. (so iisreset not required). But building the page on itself is not enough.


Interesting. i would've expected <compilation debug='true' /> to be enough to force the rebuild per change. I wonder if there's some level of page caching set up in the machine.config?


hello,I am experiencing the same problem.

http://forums.asp.net/thread/1668850.aspx

don't give up on this!

Monday, March 26, 2012

PageMethods is undefined when calling webservice from usercontrol

I have the following code to call a webservice in an aspx file. But the same code does not work in a usercontrol that I have created. I always get the message that 'PageMethods is undefined'. On the aspx page it generates the following:

<script type="text/javascript">
<!--
var PageMethods = { HelloWorld:function(s,onMethodComplete, onMethodTimeout, onMethodError) {return Web.Net.PageMethodRequest.callMethod("HelloWorld",{s:s}, onMethodComplete, onMethodTimeout, onMethodError); }
}
// -->
</script>

but in the usercontrol this variable is not generated. The following is the code in the aspx page which is very similar to the code in the user control. Please help!

<atlas:ScriptID="Script1"runat="server"Path="~/ScriptLibrary/AtlasCompat.js"Browser="Mozilla"/>

<atlas:ScriptID="Script2"runat="server"Path="~/ScriptLibrary/AtlasCompat.js"Browser="Firefox"/>

<atlas:ScriptID="Script3"runat="server"Path="~/ScriptLibrary/Atlas.js"/>

<scripttype="text/C#"runat="server">

[WebMethod]

publicstring HelloWorld(string s)

{

return"Hello '" + s +"'";

}

</script>

</head>

<body>

<formid="Form1"runat="server">

Enter your name:

<asp:TextBoxid="nameTextBox"runat="server"></asp:TextBox>

<buttonid="buttonGo"onclick="return OnbuttonGo_click()">GO</button>

</form>

<scripttype="text/javascript"language="JavaScript">

function OnbuttonGo_click()

{

//textbox string value passed as a param to the server method

PageMethods.HelloWorld(document.getElementById("nameTextBox").value, OnWebRequestComplete1);

returnfalse;

}

PageMethods are currently not supported inside user controls. I've open a bug to track that issue. Thanks.


If I put the WebMethod in the calling page I can call it from the usercontrol, which allows for the functionality that I desire. This is not as clean as I hoped for but it will work.

Thanks


Has this been fixed in the December release? It appears not, unless I am doing something incorrect. I am getting the js error 'Web' is undefined. Even my work around for this problem apears to be broken.

PageMethods is Undefined

HI,

its Urgent

I am Getting Same Error Could u please Help me Out..

Here is My Code..

using System.Web.UI.HtmlControls;

using System.Web.Services;

using Microsoft.Web.Script.Services;

using Microsoft.Web.Script;

[WebMethod]publicvoid GetNewMessage()

{

string str ="Hello";

Response.Write(str);

}

Javascript

PageMethods.GetNewMessage();

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true">

<Scripts>

<asp:ScriptReferencepath="scripts.js"/>

</Scripts>

</asp:ScriptManager>

Thanks in Advance,

Suman...

Please its Urgent...

this is not sufficient to debug your error ... you need to show us the whole thing ... and what kind of error is that? JavaScript or server error?


check this post out ... same error as yours:http://forums.asp.net/t/993893.aspx


ScriptManager has to have EnablePageMethods=true and the WebMethod has to be static.


hi here is my full code..

aspx file

<bodystyle="margin: 0px;padding: 0px;">

<formrunat="server"action="RF_Message.aspx">

<divid="ContentPanel">

<divid="MessageList">

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"EnablePageMethods="true"EnableScriptGlobalization="true"EnableScriptLocalization="true">

<%--<Scripts>

<asp:ScriptReference Path="scripts.js" />

</Scripts>--%>

</asp:ScriptManager>

</div>

</div>

</form>

</body>

</html>

<scriptlanguage="javascript"type="text/javascript">

var str = PageMethods.GetNewMessage();

alert(str);

var result = document.createElement("div");var divlist = el("MessageList");

result.innerHTML = str;

divlist.appendChild(result);

function el(id)

{

return document.getElementById(id);

}

</script>

aspx.cs file..

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Web.Services;

using System.Web.Script.Services;

using System.Web.Script;

publicpartialclassRF_Message : System.Web.UI.Page

{

//ChatManger Chatmanger = ChatManger.GetChatManager();

protectedvoid Page_Load(object sender,EventArgs e)

{

}

}

#region Script callback function

[System.Web.Services.WebMethod]

publicstaticstring GetNewMessage()

{

string str ="Hello";

return str;

}

#endregion

}

I am Getting Javascript Error While Running...

i am Getting alert Undefined...


RIght, you're executing that embedded script block as the page gets to it; pagemethods haven't been created yet (that happens during the clientside init, iirc. Try pulling all that code into your pageLoad() javascript function and see if that doens't help.

PageMethods object missing in RTM?

I tried to convert some code from the last RC to the RTM version that called PageMethods.MyMethod(), but the PageMethods object doesn't appear to be working anymore.

I started out with a fresh web.config from the RTM bits, so I know this isn't the problem.

I'm also hear anecdotally from other colleagues that the UpdatePanel control isn't working, or isn't working the way it did in the last RC.

Any feedback would be appreciated.

Hi Look at the following post:

http://forums.asp.net/thread/1545311.aspx

You need to set EnablePageMethods property of ScriptManager to true.


Sure enough. That did the trick.

Thanks for the tip!Wink


Sure enough. That did the trick.

Thanks for the tip!Wink

PageRequestManagerServerErrorException error code 403 and 502

Hi

Im having troubles like that but the error code is different.

im getting the error codes 502 and 403, i have no idea what does they mean... also on some computers, users can work on it for hours, and the message never apears..

and on another few computers, it apears as soon as the page loads, when the user comes back to the page, in the middle of the function, apparentli as random as it can be...

also, i have no login or user authentication on the page, and really have read al the forums but have no idea why or what does the error means... not even what causes it...

Heeeeelp im drownin!!!Can you provide details about your code...
So that it will be helpful to solve the problem..

Well, my code is an updatepanel, whith a common panel inside...

as soon as some values are selected in some dropdowns outside the updaqte panel, the panel, inside de update panel turns visible and a gridview is filled.

this gridview has buttons, and when a buton is pressed, the row is transferes to another grid view.

finally, the selected rows are sendt to another page.

but the strange part is that the problem apears only on some computers, and not on particular events, like just pressing a button or displayn a drop down...

the error comes randomly on those computers...

hope someone can help me


Check this url

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx


GridView inside UpdatePanel not supported fully

well i dont guess that the gridvie is the problem... because in most of the computers at the ofice, the error is never displayed... but ive ad no luck on solving the reason for that...

any other ides?


Hi,

I am having problems and errors very similar to what you describe here. Have you ever found a cause and/or resolution?

Thanks.


http://forums.asp.net/p/1038043/1438409.aspx#1438409


That is a very interesting link to a post, in that it attributes these problems to having Trace enabled. I checked my code, and although I have many Trace.Warn statements throughout my code, Trace is explicitly disabled on all the pages where there is a Trace attribute in the @.Page directive.

Thanks anyways, but I am still searching for an answer to these problems my site is having.

Dan

PageRequestManagerServerErrorException error code 12029

We seem to intermittently get a PageRequestManagerServerErrorException with the error code 12029, could someone explain that error code or point to documentation ? This happens on about 1 / 40 requests and the page is nothing special, just a datagrid inside an updatepanel and with a custom progressbar which is just a div with an animated gif that appears on beginRequest and hides on endRequest.

When you see this error is in an alert box from javascript? Are you using the latest and greatest release?

Is this on a form that requires the user to be logged in..it may be could not authenticate error... If you use fiddler and attach to it - it will actually give you the real error message on why it was aborted...if you do the digging...The SCM traps and surpresses alot of the serverside errors (in my opinion)... so when a session expires...unfortunately the ajax error codes do not map to IIS error codes...


I get the same ...

Have a ticker-tape-liek page that updates every 5 seconds .. eventually, teh session expires on teh authenticated page and I get this nasty message.


I get the same ...

Have a ticker-tape-liek page that updates every 5 seconds .. eventually, the session expires on teh authenticated page and I get this nasty message.


So the problem is the session expiring? Can you use sliding experation in forms? So the user will stay there as long as there are requests from that session?

Two solutions for you:

1. One change your web.config to allow for longer sessions - by default I think .Net 2.0 the timeout is 10 minutes (in 1.1 it was 15)

<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"timeout="555555555"/>
</authentication>

2. If that is an issue - create a IFRAME that loads a blank .aspx page that has the meta tag refresh to like every 10 minutes or something - and embedded it at the bottom of the page and merely add the style: display: none to it (so it doesn't actually show but is still visible...

3. If the ticker is calling back to the server to update the ticker or whatever - change the service you are using to actually also check for authentification (I am not sure how the authentification service works that Ajax has - but I believe the ajax.asp.net sdocumentation site has some examples...(so I don't really call this a solution ...as I have no idea how to implement it...)

The above should help you with your situation...


Hi!

I'm getting the same error, it's happening completely random and i'm sure it's not time out related

Besides any workaround, I think that the best way to solve it would be to be able to know what's error number 12029.

Any of the AJAX developers could clarify this?

Regards,

Juan


Are you using fiddler? You should...It'll tell you what exactly caused the error...there are also a couple of good extensions for firefox that will help debug the issue as well...

Also note that setting compilation debug to true and trace enabled also cause sporadic behavior when it comes to ajax...Also - do a search on the forums here for exception handling - it is possible to track the exception generated by ajax and log it... and there a few forum posts on the procedure for doing this (also code examples on the ajax.asp.net documentation site)...


Jody, thanks for your answer,


- It happens with or without debug=true: i'm testing it with the VS ASPNET server, with IIS 5 and with IIS 6. It happens everywhere and randomly, regardless of the debug setting. And I'm not tracing anywhere.

- I'm already logging the exception into SQL using this:

Protected Sub ScriptManager1_AsyncPostBackError(ByVal sender As Object, ByVal e As Microsoft.Web.UI.AsyncPostBackErrorEventArgs) Handles ScriptManager1.AsyncPostBackError
Dim conn As New SqlConnection
Try
conn.ConnectionString = ConfigurationManager.ConnectionStrings("ApplicationDatabase").ConnectionString
Dim comm As SqlCommand = conn.CreateCommand
comm.CommandText = "AjaxRecordError"
comm.CommandType = CommandType.StoredProcedure
comm.Parameters.AddWithValue("exMessage", e.Exception.Message)
comm.Parameters.AddWithValue("exStack", e.Exception.StackTrace)
comm.Parameters.AddWithValue("exSource", e.Exception.Source)
comm.Parameters.AddWithValue("exServerName", Server.MachineName)
comm.Parameters.AddWithValue("date", DateTime.UtcNow)
comm.Parameters.AddWithValue("ip", Request.UserHostAddress)
conn.Open()
comm.ExecuteNonQuery()
Catch ex As Exception
Finally
conn.Close()
End Try

So, i'm actually tracking the exception, but it isn't very helpful anyway (at least for me! :) ) :

Here is one of the records (which are all the same BTW):

exception.Message = "Input string was not in a correct format."

exception.StackTrace = " at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

exception.Source = "mscorlib"

I can see from this that is something related with parsing (I think), but as it's happening randomly, without pattern, I can't find where to start looking at.

And, finally, I'm already using Fiddler, but I must admit that I don't know where to dig to help me with the issue.

Any further help would be really appreciated! :)

Juan


Idea here:

Fiddler can be confusing sometimes. It does a take a bit to analyze...The important ones to look at are naturally any 404 errors.. Check the Headers tags when you go clicking through to inpect...

However, - I have found that that with XP - that the number of connections is limited to 10 using the IIS 5 server for XP... This causes issues because at times it doesn't matter how many times you restart IIS or close and open the broswer it doesn't go away sometimes.

I am asuming that you are stating that you are getting these errors from a remote server and not your dev xp machine?

Check your event log under applications:

The following exception was thrown by the web event provider 'EventLogProvider' in the application '/SitesEasyTest' (in an application lifetime a maximum of one exception will be logged per provider instance):

System.Web.HttpException: The EventLogWebEventProvider provider failed to log an event with the error code 0x800705DE.
at System.Web.Management.EventLogWebEventProvider.ProcessEvent(WebBaseEvent eventRaised)
at System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)

For more information, see Help and Support Center at

Is symbolic of too many connections from one client and events are occuring so rapidly that the application can can not throw any more exceptions due to connection issues...

Another error to check is this one:

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/4/2006 1:25:21 PM
Event time (UTC): 11/4/2006 9:25:21 PM
Event ID: 956e4d1c3b334e5895a42e0f0706badc
Event sequence: 32
Event occurrence: 2
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/Root/SitesEasyTest-7-128071478278125000
Trust level: Full
Application Virtual Path: /SitesEasyTest
Application Path: D:\Sites-Easy\Web\
Machine name: SITES-EASY

Process information:
Process ID: 1472
Process name: aspnet_wp.exe
Account name: SITES-EASY\ASPNET

Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.

Request information:
Request URL: http://localhost/SitesEasyTest/default.aspx
Request path: /SitesEasyTest/default.aspx
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: SITES-EASY\ASPNET

Thread information:
Thread ID: 6
Thread account name: SITES-EASY\ASPNET
Is impersonating: False
Stack trace: at Cavalia.SkinHandler.GridViewModal.InitializeSkin(Control skin) in D:\Sites-Easy\Core Modules\Cavalia.SkinHandler\GridViewModal.cs:line 322
at Cavalia.SkinHandler.SkinnedCommunityControl.CreateChildControls() in D:\Sites-Easy\Core Modules\Cavalia.SkinHandler\SkinnedCommunityControl.cs:line 223
at System.Web.UI.Control.EnsureChildControls()
at Cavalia.Admin.EditSectionsDefault.OnLoad(EventArgs e) in D:\Sites-Easy\Admin\Admin\EditSections\EditSectionsDefault.cs:line 244
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:

For more information, see Help and Support Center at

This one while confusing - when compared to the corresponding SCM error message - is actually that the SCM tried processing a request but the connection was reset yet - it still trys to restablish as another event needs something - such as say image retrieval for rebuilding the page. I had issue as well and it ended up being a image that when the ajax update panel was initialized the first time - all worked well, but then on subsequent requests - the failure on the image always caused the 'Input String of the Format" as the SCM expected a image but instead it got a 404 error page from the server...the page still rendered properly and worked after clicking ok on the error... none theless once I corrected that - I stopped getting the errors..

I think that those developing the SCM should also check the stream incoming and abort on the processing of those kind of messages...depending on the type that the scm is trying to request...

See if any of that helps.. Also - try it with the browser settings not set to Every Time and instead Automatically. If its a connection issue you may find that the issue does stop appearing as in alot of cases - I'll see 30 some requests constantly if say I am loading multiple dynamic controls in say a modal popup or something...


Jody, thanks for your info.

BTW, i;m getting this errors from BOTH my local dev machine with WIn XP and from the remote staging server with Windows Server 2000 R2.

It's interesting what you say about images, because my error is happening after refreshing a GridView that's inside an UpdatePanel, and this GridView contains a lot of templated columns with graphics.

Also, after clicking "ok" on the javascript alert the page just renders fine and you are know until the next random error happens.

I think it's worthwhile to try into that direction, before something else. Could you please share with me the solution you've used to correct that?. I know that in the AJAX documentation there is information about how to handle custom errors, but it involves writing javascript, on which i'm not very good. I just want to "clear" the error and not display an alert conditioned to if the error is of type "Input String of the Format"

Regards,

Juan


<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"timeout="555555555"/>
</authentication>

AH!! Then any hit to the website will create a session that will use memory for ever, if I create a program that hits the website every second in less than an hour the garbage collection will be kicking in!Stick out tongue


<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"timeout="555555555"/>
</authentication>

AH!! Then any hit to the website will create a session that will usememory for ever, if I create a program that hits the website everysecond in less than an hour the garbage collection will be kicking in!Stick out tongue

Actually - you are incorrect - the session will not remain in memory forever on the server side... it merely means that the authentification cookie is not expired...and therefore continuous checks are not made if the cookie is valid... therefore when the authentification occurs it doesn't actually have to do the whole process... the timeout period merely says keep the authentication cookie valid for x period of time... If your case was correct - sites like this would either a billion servers or constantly crash...Sever side - it would not matter a session is a session...it will be created regardless - the server side session management still purges inactive sessions from memory on regular basis - all the timeout value does is instruct that if the user connects again - don't destroy the cookie when re-authenticating and consider it valid instead...and use what is stored instead of going through the whole process of reconstruction...

See this article for more info on this...


Don't quote me on this as my memory is foggy on Windows 2000. Windows 2000 actually has a connection limit per client / machine. There is a registry change you can do to increase this...however, it does expose a security risk so modify with caution .. I'll give you reference to this doc:download.microsoft.com/download/2/8/0/2800a518-7ac6-4aac-bd85-74d2c52e1ec6/tuning.doc

As for how I fixed my issue... I fixed all of the urls for the images...

I'll give you a caveat however... if you use a dynamic site structure... one of two of these observations may be relevant to you.

1. With dynamic sites - in some cases the urls being requested are mapped to the root url of the site and not the actual dynamic url that should be generated - So, I fixed that code in the toolkit and recompiled. That solved half of my problems... (See my blog entry titled "Bizzarre"... how ever - if you are using master pages and all that then it won't be relevant to you...

2. I had and still have had issues with dynamically generating url paths when a SCM is on the page.

For instance - I rely heavily on this kind of syntax: ImageUr l= '<%# ResolveUrl("~/Images/admin/collapse.jpg")%>'

It generates the actual physical path to the image. It doesn't work in a page with a SCM..(although does everywhere else) So I have to resort to defining the imageurl in codebehind - which does work...And this goes for the Gridview. Defining images statically (int the ascx or aspx page) works but not if some kind of dynamic generation in the aspx or ascx page...but if you do it codebehind - it works...

So correcting both of those issues resolved my issue (keep in mind that each request for a image is actually a separate connection to the server)...

For suppressing the error message and 'pretending it didn't happen on the client side..... there is a great example on the docs site...

So, hopefully that will help...

PageRequestManagerServerErrorException error code 12002

Hi , i'm having this problem, i need to run an store procedure from a aspx page and i'm having this error. It seems that is an request time out. The Procedure last almost 1 hour and 15 minutes. Please help me.

the message i have is ... and it's shown by the 60 minute of execution.

I'm using Ajax v 1.0. , ScriptManager and UpdatePanel.

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error ocurred while processing the request
on the server. The status code reutrned from the server was: 12002

Hi Tony,

You can set the AsyncPostBackTimeout property of the ScriptManager. In your scenario, you can define it to be about 1 hour and a half (5400 secs).
Just make sure that the other time-out variables (session, forms authentication cookie and roles cookie) are not interfering as well.

Also, check the httpRuntime executionTimeout property if you are working with file uploads.

I hope this helps,

Juan


Hi Tony, I am facing same problem, PageRequestManagerServerErrorException error code 12002 exception. My procedure takes apprx 2hrs to run..

goyou have got any solution please pass it to me atshiekh.Bilal@.gmail.com

Thanks

Bilal


Hi Tony, I am facing same problem, PageRequestManagerServerErrorException error code 12002 exception. My procedure takes apprx 2hrs to run.. goyou have got any solution please pass it to me atshiekh.Bilal@.gmail.com

Thanks Bilal

PageRequestManagerServerErrorException (Status Code: 413)

I hope someone can help me.

This is the message:
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 413.

The scenerio is quite simple: A master page contains the Script Manager. The others pages have their own update panels and controls (nothing special, just list box and grids).

Sometimes the above error ocurrs, sometimes not.

The application is on HTTPS and requires client certificates.

Any idea?

Regards,
Alano

Hi Alano,

The status code 413 means that Request Entity Too Large.
The 413 status code indicates that the request was larger than the server is able to handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.

Please?try?to set the maxRequestLength property to a larger value. For how, please refer to this:
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx

Hope this helps.

Raymond,

Thanks very much for your answer, the first about this problem I've seen on the Internet.
Our web.config already has a maxRequestLength set to 2000000. We don't expect use this, but we have it on web.config. I also have set the UploadReadAHeadSize on IIS 6.0 to 64k.
If you have another hint, I'll appreciate that.

Thanks again.

Alano.


We solved our problem, I suppose, with a IIS metabase parameter (UploadReadAHeadSize).
Some pages of our web site has more than 80k. I have set the that IIS metabase parameter to 128k and things are going now.
For more information you can see:
http://technet2.microsoft.com/windowsserver/en/library/0ef55842-24d2-4060-bb98-d69e2877a6671033.mspx?mfr=true

PageRequestManagerServerErrorException, status code 504

I got the following error message on my ASP.NET AJAX web app:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 504

What does it mean?Huh?

Hi monkeyno,

10.5.5 504 Gateway Timeout

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.

 Note: Note to implementors: some deployed proxies are known to return 400 or 500 when DNS lookups time out.

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

You get the Sys.WebForms.PageRequestManagerServerErrorException whenever the aspx handler throws an exception responding to an ajax.net update panel submit. If you took away the update panels you would see the classic asp.net exception page with lots of potentially useful information like the stack trace, but since the form submit has been ajaxified you just get a generic error message through a javascript alert. For example create an aspx page with an update panel containing a button and a multiline text control with the text set to "".

monkeyno:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.

Clicking on the button you'll get the generic error: The status code returned from the server was: 500 Now try it again after placing the controls outside of the update panel. When you click the button you will get an exception page with details about a potentially dangerous/script-attack form value. The exception evens details a possible (though non-recommended) workaround of adding the attribute, ValidateRequest="false", to the aspx page directive. Of course for a real page it's a pain to strip out the update panels, so here is a quicker way to see the exception details. Just add the attribute, EnablePartialRendering="false", to your ScriptManager like below. Just set it back when you're done troubleshooting the issue.

Saturday, March 24, 2012

PageRequestManagerServerErrorException with error code 500

I am working on an ASP.NET AJAX web application. I got a PageRequestManagerServerErrorException with error code 500 every time when I try to populate a text box with a string contains some HTML tags (like <BR> for example). The full error message "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500" appears in an alert box from javascript.
The main problem is that every next async post back generates the same error on the client side. Of course, I can check the passing string preliminarily, but my question is:
Is there a way to handle an error like this so the web application continues to run?
I have already check to clear error in Application Context on Application_Error event with Context.ClearError(), but it does not affect.

Hi!,

That exception is a callback exception and the PageRequestManager is the AJAX ScriptManager control.

You could customize the callback errors using the AsyncPostBackErrorMessage property of the ScriptManager.

Also, if you want to handle the error on server-side, use the ScriptManager_AsyncPostBackError event.

Please refer to this:http://support.microsoft.com/kb/193625

Check this articlehttp://blog.g9th.com/2007/01/14/unable-to-validate-data-at-systemwebconfigurationmachinekeysectiongetdecodeddata.aspx

Let me know if you need more info.
You can also see this thread for more help:http://forums.asp.net/t/1115331.aspx


Hi chetan.sarode!

Thank you for your post.

Yesterday I tried to handle this error on ScriptManager_AsyncPostBackError event, but unfortunately it doesn't fire.

The only one event I found to handle is Application_Error on Global.asax. I could ClearError in current HttpContext, but it doesn't affect on client side. The error still apears after every next async post back (the only difference is that alert box in javascript with the error message doesn't appear).

So, is there a way to prevent the response from the server to the client in that case. I mean it is better for me, the server sends nothing to the client instead of an error that stops every next async post back.

I appreciate any advice.

Thanks again.


I will look into that more...

Will let u knowSmile


Hi,

I got the same error a few days ago.

The following is my code that got the error:

<%@. Page Language="C#" %>

<%@. Import Namespace="System.Xml" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();

//string strxml = "<books><book>asp</book><book>asp1</book><book>asp2</book></books>";
string strxml = HiddenField1.Value;//.Replace("begin", "<").Replace("end", ">").Replace("slash", "/");
//DataSet myDS = new DataSet();
//XmlTextReader xtr = new XmlTextReader(new StringReader(strxml));
//myDS.ReadXml(xtr);
//DropDownList1.DataSource = myDS;
//DropDownList1.DataValueField = "book";
//DropDownList1.DataTextField = "book";

System.Xml.XmlDocument sa = new System.Xml.XmlDocument();
sa.LoadXml(strxml);
System.Xml.XmlNodeList saa = sa.GetElementsByTagName("book");
DropDownList1.DataSource = saa;
DropDownList1.DataValueField = "InnerText";
DropDownList1.DataTextField = "InnerText";

DropDownList1.DataBind();
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>

<script language="javascript" type="text/javascript">
// <!CDATA[

function Button2_onclick() {
document.getElementById("HiddenField1").value = test.XMLDocument.xml;
// var a = "";
// while(document.getElementById("HiddenField1").value != a){
// var a = document.getElementById("HiddenField1").value;
// document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("<","begin");
// document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("/","slash");
// document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace(">","end");
// }
document.getElementById("Button1").click();
}

// ]]>
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList><div style="visibility: hidden">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>
<input id="Button2" type="button" value="button" onclick="return Button2_onclick();" />
<asp:HiddenField ID="HiddenField1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<xml id="test">
<books>
<book>asp</book>
<book>asp1</book>
<book>asp2</book>
</books>
</xml>
</form>
</body>
</html>

I resolved it by changing the code into the following code:

<%@. Page Language="C#" %>

<%@. Import Namespace="System.Xml" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();

//string strxml = "<books><book>asp</book><book>asp1</book><book>asp2</book></books>";
string strxml = HiddenField1.Value.Replace("begin", "<").Replace("end", ">").Replace("slash", "/");

//DataSet myDS = new DataSet();
//XmlTextReader xtr = new XmlTextReader(new StringReader(strxml));
//myDS.ReadXml(xtr);
//DropDownList1.DataSource = myDS;
//DropDownList1.DataValueField = "book";
//DropDownList1.DataTextField = "book";

System.Xml.XmlDocument sa = new System.Xml.XmlDocument();
sa.LoadXml(strxml);
System.Xml.XmlNodeList saa = sa.GetElementsByTagName("book");
DropDownList1.DataSource = saa;
DropDownList1.DataValueField = "InnerText";
DropDownList1.DataTextField = "InnerText";

DropDownList1.DataBind();
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>

<script language="javascript" type="text/javascript">
// <!CDATA[

function Button2_onclick() {
document.getElementById("HiddenField1").value = test.XMLDocument.xml;
var a = "";
while(document.getElementById("HiddenField1").value != a){
var a = document.getElementById("HiddenField1").value;
document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("<","begin");
document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("/","slash");
document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace(">","end");
}
document.getElementById("Button1").click();
}

// ]]>
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList><div style="visibility: hidden">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>
<input id="Button2" type="button" value="button" onclick="return Button2_onclick();" />
<asp:HiddenField ID="HiddenField1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<xml id="test">
<books>
<book>asp</book>
<book>asp1</book>
<book>asp2</book>
</books>
</xml>
</form>
</body>
</html>

For more information,seehttp://forums.asp.net/t/1126640.aspx(embedded xml datasource)

Thanks

PageRequestManagerServerErrorException with 500 error code

In javascript I'm setting the value property of a button within an update panel before calling click() on the button to refresh the update panel. (I need to refresh an update panel and pass extra data on the callback, and no one on this forum has yet described a better way of doing it than this.)

This was all working in tests that I did last week, but I'm now getting the following error message box in IE:

"Sys.WebForms.PageRequestManagerServerErrorException: An unkown error ocurred while processing the request on the server. The status code returned from the server was: 500"

Any ideas?

I have the same error but on a couple of dropdown which update one another's datesource with updatePanels.

If i change the value of the first dropdown for several times, always the third tine gives this error.

I found on a post the setting TRACE off resolves but not for me.

Any ideas ?

Just try to change frequently some controls which use updatepanels (for other controls) and see what's happen.

Thank's

Sorin


I found also that If I have more than 3 UpdatePanels in a Page I get this error after 3 callbacks.

If I have on page Trace="false"and "EnableEventValidation="true"

I get this error:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Thank's again


I've also tried setting the value of a hidden field and a hidden textbox and both raise the same error.

I cannot even paste data into a textbox and then do a postback without getting this error.

I'm also EXTREMELY TIRED OF MICROSOFT IGNORING ALL OF MY POSTS!!!!!!!!!!! Angry

PageRequestManagerServerErrorException: 401

I wrote some server code that work fine in VWD 2008 Express Edition. When I uploaded the page to my site (including the dll that my code uses), I get the following error:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned by the server was: 401. How can I find out where the problem is comming from?

Thanks,
Yoni

Server Error 401 is an "Unauthorized" error.


And how can I find out which peace of code is giving me this error?

Thanks,
Yoni


It's probably going to be something where it is trying to access a page, database, etc. that it doesn't have permissions to. I would set breakpoints and just see how far the code is getting.


Thats a problem. As I said, the page and code work fine on my computer - only when I move it to my site I get an error. How do I insert breakpoints? Do you mean I should use "return" statements in diff places until I find where the error originates?

Thanks,
Yoni


On the server you couldn't use breakpoints. I personally am a fan of just putting an extra blank <asp:Label> on the page and writing things to it to see values and my progress. Place occasional "I got to ____ function" statements in the label's text.


I wouldlove to do that: I have tried it, but it doesn't work. My server code takes about 10 seconds - 5 minutes to run and during that time I can't post nothing to the page... I asked how to do this in another forum, but I was given extremely complicated ways of doing this, that I could not do. Do you know how I can change a label while my server code is running?


Hi,

Thank you for your post!

Check out the following link:

http://blogs.msdn.com/david.wang/archive/2005/07/14/HOWTO_Diagnose_IIS_401_Access_Denied.aspx, David Wang said in this article:

One of the most common questions asked about IIS on the newsgroups as well as Microsoft Product Support is "why am I getting 401 Access Denied"?

There are many, many possible causes and variations, but from the IIS perspective, the top-level, logical categories are fixed. This information can help dramatically narrow down the scope of any investigation, but unfortunately, few people know to take advantage of this information. This is what I am going to address with this entry - how to use and diagnose the 401.x error codes on IIS.

Step 1: Determine the SubStatus Code

Step 2: Determine Course of Action

401.1 Denied by Invalid User Credentials

401.2 Denied by Server Configuration

401.3 Denied by Resource ACL

401.4 Denied by Custom ISAPI Filter

401.5 Denied by Custom ISAPI/CGI Web Application

Conclusion

401.1 through 401.3 errors are associated with IIS request processing and allow the logical interpretations and assumptions that I listed above.

Meanwhile, the 401.4 and 401.5 errors are the most arbitrary to diagnose since custom ISAPI DLLs and CGI EXE can cause IIS to behave in non-obvious manners. Thus, much of the logical assumptions about 401.x do not apply.

I hope that this information has been useful in deciphering theh 401.x errors from IIS. If you have additional questions, feel free to post a comment or post a private question via the "contact" link.

Recently, we have also released a tool,AuthDiag, to help troubleshoot IIS access denied issues. You can download it fromthis location. In particular, it has a feature to hook in to various failure points in IIS and directly troubleshoot what is failing on a given request - you need to see and try it out!

If you have further questions, let me know.

Best Regards,

Panel Closed

Hello

I use the autocompletextender and the CompletionListElementID="myPanel" because I want to use a scrollable area

my entire code is like this

 <asp:Panel runat="server" id="myPanel" Height="100px" ScrollBars="Vertical" ></asp:Panel> <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TBSearch" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionInterval="1" EnableCaching="true" CompletionSetCount="12" CompletionListElementID="myPanel" />
 
and I have a problem (of course)
The Panel open itself well and I get a scrollbar but when I click on the scrollbar to make it moving, the panel get closed.
 
Any ideas `?
 
Thx in advance 

Hi Gilloux,

I have wrote a sample based on your description but unable to reproduce your problem. My testing shows that scrollbar works fine. When click on it, the panel won't get closed unless you click on the list.

Here is my sample:

Aspx:

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TBSearch" runat="server"></asp:TextBox> <asp:Panel runat="server" ID="myPanel" Height="100px" ScrollBars="Vertical"> </asp:Panel> <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TBSearch" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionInterval="1" EnableCaching="true" CompletionSetCount="12" CompletionListElementID="myPanel" /> </form>

WebService:

<%@. WebService Language="C#" Class="AutoComplete" %>using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Collections.Generic;[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][System.Web.Script.Services.ScriptService]public class AutoComplete : System.Web.Services.WebService { public AutoComplete() { } [WebMethod] public string[] GetCompletionList(string prefixText, int count) { if (count == 0) { count = 10; } if (prefixText.Equals("xyz")) { return new string[0]; } Random random = new Random(); List<string> items = new List<string>(count); for (int i = 0; i < count; i++) { char c1 = (char)random.Next(65, 90); char c2 = (char)random.Next(97, 122); char c3 = (char)random.Next(97, 122); items.Add(prefixText + c1 + c2 + c3); } return items.ToArray(); }}

My system environments: VS2005 + Asp.Net 2.0 Ajax Extensions V1.0 + Ajax Control Toolkit V10618 +Windows 2003.

Please compare your code with mine.If it doesn't work, please confirm whether your Control Toolkit Version is the latest release version or not. If not , please upgrade it.

Hope this help.

Best regards,

Jonathan

Wednesday, March 21, 2012

Partial page update question

Why isn't this section of code not calling mychkShowLegend_CheckedChanged in my code behind? I can put the same code that changes the visible to true/false based on checked in my PageLoad, and it works...otherwise, I take it out of the PageLoad and just leave it in thechkShowLegend_CheckedChanged and it doesn't work. Here's my code:
 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:CheckBox ID="chkShowLegend" runat="server" AutoPostBack="True" Text="Notification Legend" />  <asp:Panel ID="Legend" runat="server" Visible="false"> <div id="lblLegend" style="Z-INDEX: 3; WIDTH: 477px; HEIGHT: 115px; border: solid 1px; padding-right: 5px; padding-left: 7px; padding-bottom: 5px; padding-top: 5px;" align="left" runat="server"> <font face="Arial" size="4"> <span style="font-size: 10pt;"> <span style="color: black"><strong>Black Text</strong></span> - Interval value received; operating environment normal<br /> <span style="color: gray"><strong>Gray Text</strong></span> - Interval value not received; previous valid interval substituted<br /> <span style="color: royalblue"><strong>Blue Text</strong></span> - Setpoint has changed from previous interval value<br /> <span style="color: crimson"><strong>Red Text</strong></span> - OOME for this interval<br /> <span style="color: darkorange"><strong>Orange Text</strong></span> - SCADA value is out of range compared to setpoints<br /> <span style="color: forestgreen"><strong>Green Text</strong></span> - LIP value has a different sign (+/-) compared to previous interval<br /> *Please check above indicators for current interval; multiple indicators are possible </span> </font> </div> </asp:Panel> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="chkShowLegend" EventName="CheckedChanged" /> </Triggers> </asp:UpdatePanel>In my code behind: protected void chkShowLegend_CheckedChanged(object sender, EventArgs e) { if (chkShowLegend.Checked) Legend.Visible = true; else Legend.Visible = false; }
 

I have tried your code, its working perfectly for me without any modification to your code.

canyou try by removing <triggers> section of update panel sincechkbox is inside the updatepanel it will automatically taken as atrigger(since childrenastriggers property of updatepanel is havingdefault value "true").

Some references.

http://ajax.asp.net/docs/mref/P_System_Web_UI_UpdatePanel_ChildrenAsTriggers.aspx

http://ajax.asp.net/docs/mref/P_System_Web_UI_UpdatePanel_UpdateMode.aspx

Isuppose you are using other update panels alose on the page. which maycausing the issue.In that case its better if you can put the completepage code so that we can look into that.


Removing the trigger section worked perfectly. I do have multiple update panels on this page and I was wondering if that was causing problems; the other two have timers as triggers, a 1 second timer and a 30 second timer.

Thanks for the help!

Partial rendering issue with AJAX

I have following code working fine with ATLAS with partial rendering in IE and Firefox. But after I move the app to AJAX beta 1.0, it causes the the whole page rendering with Firefox 2.0 but it works fine with IE 6.x.

function setID(myID)
{
opid = document.getElementById ('<%=txtMyID.ClientID%>');
opid.value=myID;
document.getElementById('<%=ibtnMyButton.ClientID%>').click();
}

The page looks like:

<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional" runat="Server">
<ContentTemplate>

<asp:UpdatePanel ID="UpdatePanel2" RenderMode="Inline" UpdateMode="Conditional" runat="Server">
<ContentTemplate>

<asp:TextBox ID="txtMyID" runat="server" ></asp:TextBox>

<asp:ImageButton ID="ibtnMyButton" runat="server" ImageUrl="../Images/go.gif"></asp:ImageButton>
........

</ContentTemplate>
</asp:UpdatePanel>

</ContentTemplate>
</asp:UpdatePanel>

How to solve this issue?

Try to change your codes as the following.
<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline"ChildrenAsTriggers="false" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel2" RenderMode="Inline"ChildrenAsTriggers="false" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<asp:TextBox ID="txtMyID" runat="server" ></asp:TextBox>
<asp:ImageButton ID="ibtnMyButton" runat="server" ImageUrl="../Images/go.gif"></asp:ImageButton>
........
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
Wish the above can help you.
Thank you, Jasson, It works.