Click here to Skip to main content
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 18: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 Peter Leow 255
1 Mika Wendelius 240
2 CHill60 195
3 TheRealSteveJudge 180
4 Zoltán Zörgő 178
0 Sergey Alexandrovich Kryukov 8,658
1 OriginalGriff 6,591
2 Peter Leow 3,982
3 Zoltán Zörgő 3,604
4 Richard MacCutchan 2,510


Advertise | Privacy | Mobile
Web02 | 2.8.150123.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