Question regarding ButtonTester
Brought to you by:
jlittle82
Some buttons included on our web pages initially fire a
javascript function to display an alert to the user (e.g, a
confirmation to ensure they wish to save any changes).
Is there any way this can be handled or removed using
the ButtonTester and postback invoked without
changing the code on the web page?
Logged In: YES
user_id=826251
see reply about AnchorTester. With the modification I
suggested, you can use this class to test just about any
attribute on any html element.
Logged In: YES
user_id=951603
As our page was using an HTML Input Button of type=button
with an onclick event to fire the javascript confirmation
message and an onserverclick event to handle the postback,
the html rendered is similar to the following:-
onclick="if(!myJavascriptFunction()){ return false;}
__doPostBack('Button1','')"
Creating your own class which inherits from the ButtonTester
allows you to expose the MyBase.PostBack
(postBackScript:=postBackScript) which looks for the
expression __doPostBack to submit the form. This has the
effect of skipping the javascript function and just performing
the postback event.
Logged In: YES
user_id=499667
nsargeant, should we change NUnitAsp to support this natively?