locked
ModalPopupExtender1 and validation RRS feed

  • Question

  • User-631683198 posted

    hi,

    i have a text box where a user can enter there email address for joining a newsletter. in the button click event i am using the mail message class to capture and send the email.

    Once they hit suBmit button I want a ModalPopupExtender1 to show and say congratulations.

    if however they do enter a valid email, i do not want the ModalPopupExtender to show AS i am using a asp.net validation control to check the textbox. it is still showing which is a problem and confuses the user.

    Thank you for any tips in c sharp

     

    prontonet

    Wednesday, November 18, 2009 10:21 PM

Answers

  • User2115139740 posted


    use Show()

    ModalPopupExtender1.show()

    Panel1.Visible = true;


    not Enabled


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 19, 2009 4:24 AM

All replies

  • User2115139740 posted

    in button click event can you check page.isvalid

    eg :-

    if(page.IsValid)

    {

       //show ur modal pop up here

    }

    Wednesday, November 18, 2009 10:26 PM
  • User-631683198 posted

    hi,

    i tried but the modal still pops up even so which is in a panel. amny ideas?

     

    protected void Button1_Click(object sender, EventArgs e)
        {
           
            if (Page.IsValid)
            {

    ModalPopupExtender1.Enabled = true;

    Panel1.Visible = true;

            }

            else
     {
                

    ModalPopupExtender1.Enabled = false;

    Panel1.Visible =false;

    }

        }

    Thursday, November 19, 2009 4:14 AM
  • User2115139740 posted


    use Show()

    ModalPopupExtender1.show()

    Panel1.Visible = true;


    not Enabled


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 19, 2009 4:24 AM
  • User-631683198 posted

    great many thanks!! 

    Thursday, November 19, 2009 5:20 AM