How to get result using ScriptManager.RegisterStartupScript method [Resolved]

Posted by Amritha444 under Regular Expressions on 5/3/2011 | Points: 10 | Views : 50906 | Status : [Member] | Replies : 5
Hi all

im using ScriptScriptManager.RegisterStartupScript to display result
ScriptManager.RegisterStartupScript(Page, GetType(), "MyScript", "alert('Sucessfully Saved.');", true);

it has option ok only

I want same message box with ok and cancel ..when i click ok only i want to proceed to next step.otherwise want to be there in the same page

How to do that ..

Thanks in advance

Regards

Amritha




Responses

Posted by: Nishithraj on: 5/3/2011 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Try like this

http://stackoverflow.com/questions/4949662/javascript-confirm-message-problem

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 5/3/2011 [Member] Bronze | Points: 25

Up
0
Down
Here I don't know the exact requirement. You can also try the confirm box as below.

ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:if(confirm('Sucessfully Saved') == false) return false;", true);

Please let me know if it's working

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 5/3/2011 [Member] Starter | Points: 25

Up
0
Down
Hi


ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:if(confirm('Sucessfully Saved') == false) return false;", true);


this code is not working..

i just want yes and no in the message box and want to know which button user clicked to perform differnt operation for two cases

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 5/3/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Nishithraj

http://stackoverflow.com/questions/4949662/javascript-confirm-message-problem

this solution works

Thank you

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 5/3/2011 [Member] Bronze | Points: 25

Up
0
Down
Okey, Amritha. Thanks for letting us know.

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response