Confirm Message Box at Server Side

Posted by Shoyebaziz123 under ASP.NET on 6/20/2012 | Points: 10 | Views : 3617 | Status : [Member] | Replies : 1
Hi All,

I want to show confirm message at server side , for that i have write this code

protected void btnSubmit_Click(object sender, EventArgs e)
// here goes some code

now i am opening confirm dialoge

string str = "No Paid Leaves Left , Press OK For Without Pay?";
this.ClientScript.RegisterStartupScript(typeof(Page), "Popup", "ConfirmApproval('" + str + "');", true);

lblMessage.Text = hidCount.Value;

if i get hidCount.Value > 0 then i want to proceed further code

but i always get 0 value... i am setting ok button click value to hidden field using javascript
like this

function ConfirmApproval(objMsg)
return true;
document.getElementById("<%=this.hidCount.ClientID%>").value = "0"
return false;

what is going run ?

i have also use ScriptManager.RegisterStartupScript for confirm but it always execute at the end of code ..


Posted by: Gemamgall on: 6/27/2012 [Member] Starter | Points: 25

there is a syntax issue

Try using
this.ClientScript.RegisterStartupScript(typeof(Page), "Popup", "<script language='javascript'> ConfirmApproval('" + str + "');</script> ", true);

Thanks and Regards,

Vinay Gandhi

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

Login to post response