Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding client-side script after _dopostback
Message
From
06/06/2006 13:14:05
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01127355
Message ID:
01127416
Views:
16
Don,

There is no 'clean' way to do this, but it is possible by creating your own HTTP module to intercept the outgoing HTML and insert the script into the appropriate do_postback.

This seems like a good article to get started: http://www.15seconds.com/issue/020417.htm

>I'm working on a form and need to insert some code into the "_dopostback" function thats created on RUN AT="server" controls. I want to call an additional CLIENT-SIDE script AFTER the native behavior of the _dopostback...
>
>how/where should I go. The client-side script is no problem and I already have that in the HTML portion of the .aspx page setup.
>
>Basically, the following is automatically generated for the aspx page.
>I changed the angle brackets with {} for the script/end script parts
>
>{script language="javascript" type="text/javascript"}
>	function __doPostBack(eventTarget, eventArgument) {
>		var theform;
>		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
>			theform = document.Form1;
>		}
>		else {
>			theform = document.forms["Form1"];
>		}
>		theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
>		theform.__EVENTARGUMENT.value = eventArgument;
>		theform.submit();
>
>                *****************************************************
>                CALL MY CLIENT-SIDE FUNCTION HERE... AFTER THE SUBMIT
>
>	}
>{/script}
>
Previous
Reply
Map
View

Click here to load this message in the networking platform