Need Help
this is my problem
in a webform user have to enter the email id, if he click the button,i have to check whether the mail id exists or not from the database,i solved this part,problem is here,i have to ask confirmation from the user whether to change the email id or continue with the same,here i dont know what to do, how to call clientside script from the C# and vice versa.
Thanks in advance
# 1 Re: Need Help
hi,
try this one
// add the following client side script in the design
<script language="javascript">
function check(){
var str= confirm('u want to continue');
if (str)
return true;
else
return false;
}
</script>
// let the controls be
<asp:Button id="ChangeEmailIdBut" runat="server" Text="Button"></asp:Button>
<asp:TextBox id="EmailIdTxt" runat="server"></asp:TextBox>
// now use the Attributes.Add()
private void Page_Load(object sender, System.EventArgs e)
{
ChangeEmailIdBut.Attributes.Add("OnClick", " return check()"); //
}
Hope for the best...