Click here to Skip to main content
11,716,249 members (88,801 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Here I want to Show Javascript Mesage ."This PassCode Already Exists!Are you Shore you want to update this.

 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 3-Jan-13 17:30pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try this.

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);
                           
}
  Permalink  
v4
Comments
pankajgarg1986 at 3-Jan-13 23:54pm
   
then javascript retrun false.i want p.UpadteIssuePass is not called.
prashant patil 4987 at 3-Jan-13 23:58pm
   
hey check solution 1 m updating that solution.
if this is your solution then accept it as Answer
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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" />


<script>

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 ...




}

</script>


if your problem is not solve this please give your comment
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 634
1 Maciej Los 385
2 Richard MacCutchan 280
3 F-ES Sitecore 245
4 OriginalGriff 175
0 Sergey Alexandrovich Kryukov 1,029
1 Maciej Los 464
2 Richard MacCutchan 430
3 CHill60 415
4 OriginalGriff 415


Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100