Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here I want to Show Javascript Mesage ."This PassCode Already Exists!Are you Shore you want to update this.

C#
 if (passcode == ddlpasscode.SelectedValue && memberid == Convert.ToInt32(ddlname.SelectedValue))
                      {
                          //Here i want JavaScript Message Confirmation.Then User Click on Ok UpadteIssuePass Function is called.Unless he Cancel UpadteIssuePass is not Called

//this function is called when user click on ok.Unless No.
                        p.UpadteIssuePass(ddlpasscode.SelectedValue, Convert.ToInt32(ddlname.SelectedValue), Convert.ToInt32(txtcounting.Text), crtby, con, tran);

                      }
Posted

try this.

C#
if(ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:if(confirm('This PassCode Already Exists!Are you Shore you want to update this.') == false) return false;", true))
{
      p.UpadteIssuePass(ddlpasscode.SelectedValue,     Convert.ToInt32(ddlname.SelectedValue), Convert.ToInt32(txtcounting.Text), 
crtby, con, tran);
                           
}
 
Share this answer
 
v4
Comments
pankajgarg1986 3-Jan-13 23:54pm    
then javascript retrun false.i want p.UpadteIssuePass is not called.
prashant patil 4987 3-Jan-13 23:58pm    
hey check solution 1 m updating that solution.
if this is your solution then accept it as Answer
You can Do this using jquery also it is the best method for this.
so many method to do this :-1 is


<asp:button name="btn" id="btn" onclic="codebehind Mehtod" occlientckick="return ValidationFunction" xmlns:asp="#unknown">




function ValidationFunction()
{

Check Condition if As You PReviously DiD into CodeBehing
and Than

f(confirm('This PassCode Already Exists!Are you Shore you want to update this.'))
{

return true
}
else
{
return False;
}


//explaination :-

//when Some one click your button than Client Clik fire and Show Confirm Popup if //user click this than your form post into the function which is your code behind ...




}




if your problem is not solve this please give your comment
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900