here's a little more detail...
The app is hosted in a portal environment. The portal appends a "token" number to each form on the page to ensure unique form names (the portal page could have more than one form). For example, if I have <form id="form1"> it will change it to something like <form id="form1_1458">. A javascript error occurs after the page loads saying "'this._form' is null or not an object."
I did a viewsource of the page and I see the following:
<script type="text/javascript">//<![CDATA[Sys.WebForms.PageRequestManager._initialize('form1_1458', document.getElementById('form1'));Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);//]]></script>
I'm not sure if this is the issue but the scriptmanager is referencing to form1.
What I want to do is force the scriptmanager to get document.getElementById('form1_1458'). How can I accomplish this?
the cz of the problem not tht u have a form name inconveniance its about an html error u can run ur page under firefox successfully
u can fix ur prob by checking the syntax b4 the form tag the body tag or another tag check for html syntax errors like added " or unclosed tags
hope being usefull......
I'm surprised this hasn't caused you issues before. If you think about it the server ID is changed which could throw off all control names and references.
I'm not sure that you can change this at run-time without some serious manipulation to the AJAX framework. My thought is that you could get access to form1 using something like document.forms[0] which will get the first form (without using the ID)
-Damien
where/how do I tell the scriptmanager to use document.forms[0]?
Not sure... from my last post: "I'm not sure that you can change this at run-time without some serious manipulation to the AJAX framework..."
The form reference gets set by the ASP.NET AJAX Framework's client scripts; you don't specify the form. Seehttp://www.asp.net/ajax/documentation/live/overview/ScriptManagerOverview.aspx for more info on the ScriptManager
-Damien
finally figured this one out. Many thanks to http://aspnetresources.com/articles/HttpFilters.aspx
No comments:
Post a Comment