Tuesday, May 21, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
191
rated 0 times [  196] [ 5]  / answers: 1 / hits: 15422  / 12 Years ago, sat, june 16, 2012, 12:00:00

I am having a page where i need to confirm whether to show updated grid or not



I am calling a javascript function using



ScriptManager.RegisterStartupScript(this, typeof(string), Error, confirm('Are u sure');, true);


What I want to know is how to get the return value of confirm in C# code behind.


More From » c#

 Answers
104

Instead of this



ScriptManager.RegisterStartupScript(this, typeof(string), Error, confirm('Are u sure');, true);


use this



ScriptManager.RegisterStartupScript(this, typeof(string), Error, ConfirmUser('Are u sure');, true);

<script type='javascript'>
function ConfirmUser(msg)
{
if(confirm(msg))
__doPostBack('','');
}
<script>


see following links to know more about __doPostBack



1
2


[#84868] Thursday, June 14, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jeffery

Total Points: 180
Total Questions: 114
Total Answers: 117

Location: Chad
Member since Mon, Dec 5, 2022
1 Year ago
;