Click here to Skip to main content
15,169,285 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
protected void Button1_Click(object sender, EventArgs e)
        if ((DropDownList1.SelectedItem.Text == "---- Select ----") || (TextBox1.Text == "") || (TextBox2.Text == ""))
            Label1.Visible = true;
            Label1.Text = "All fields are mandatory, can not left blank.";
            TextBox1.Text = "";
            TextBox2.Text = "";
        else if ((TextBox1.Text != TextBox2.Text))
            Label1.Visible = true;
            Label1.Text = "Confirm Password does not match, Try Again.";
            TextBox1.Text = "";
            TextBox2.Text = "";
            string lsUsrName, lsPwd;
            lsUsrName = DropDownList1.SelectedItem.Text;
            lsPwd = TextBox1.Text;

            Response.Write("<script>var resp = window.confirm ('Are you sure want to change password?');alert(resp);</script>");


alert message is giving the correct , which i select, how to store it in a c# variable for further process?????? Help me experts ....


Hidden Field is way but there are some security constrain so be careful.

Read this [^]
KManishS 15-Jan-13 6:55am
how to use it in my code?????
Suvabrata Roy 15-Jan-13 7:02am
KManishS 15-Jan-13 7:53am
done it, not working...
Suggest experts.
Suvabrata Roy 15-Jan-13 8:11am
you can use query string.
Or Read this article Link

For your problem you can use ModalPopupExtender control from Ajax toolkit. Steps:-

1. Add a Modal Popup Extender to your .aspx page and then add two buttons on it.

2. Open that popup by calling :-

3. Now add the event to your 'OK' button.

If you need any other assistance please put comment. I will help you.

KManishS 15-Jan-13 8:03am
permission deny to use AJAX, any other solution Sir???
[no name] 15-Jan-13 10:49am
You can create your popup by using div and CSS. That will do the same work for you...
KManishS 16-Jan-13 8:24am
any sample???

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