Link to home
Start Free TrialLog in
Avatar of Angela4eva
Angela4eva

asked on

Asp.net RegisterClientScriptBlock

I am calling this javascript from my asp.net. Can some one please let me know how i can catch whether user select Ok or cancel and do something?
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "showmessage", "confirm('" + strmsg + "');", true);
i want to know whether the use click Ok or cancel and do if Ok return and Cancel nothing
Avatar of strickdd
strickdd
Flag of United States of America image

if(confirm(' + strmsg + ')){ MyFunctionOnSuccess() }
Avatar of Angela4eva
Angela4eva

ASKER

where should i put this line?
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "showmessage", "if(confirm(' + strmsg + ')){ MyFunctionOnSuccess() };", true);
I want to execute the next step if ok, otherwise(Cancel) I want to  return.
I do not want to call a function.
ASKER CERTIFIED SOLUTION
Avatar of strickdd
strickdd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
next step is next line after
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "showmessage", "if(confirm(' + strmsg + ')){ MyFunctionOnSuccess() };", true);
even the your script form does not work.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
tahnks