Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how to validate data inside a ModalPopupExtender Ajax control?

how to validate data inside a ModalPopupExtender Ajax control?

how to validate data inside a ModalPopupExtender Ajax control?


I'm using a ModalPopupExtender with two buttons, an OK button and a Cancel button?

I want to link the OK button to both the onOKScript and onClick event.

In my ModalPopupExtender I have a bunch of DropDownList that I need the user to fill out before closing the ModalPopupExtender.
How do I validate the information from the user without closing the ModalPopupExtender and if the information is valid, how do I do a postback to the server to process the information selected by the user?

My idea was to use both the onOKScript to run some Javascript code and the onClick event to run server-side code.

but which one come first the onOKScript and then the onClick event ? or is it the other way around? and any idea on how to validate the DropDownList information in Javascript? I'm not very familiar with Javascript code.

I'm using ASP.NET 4.0 and the ModalPopupExtender Ajax control.


RE: how to validate data inside a ModalPopupExtender Ajax control?

Use the RequiredFieldValidator for each of the dropdown lists the user must make a selection from.


<asp:RequiredFieldValidator ID="RequiredFieldValidator1" InitialValue="-1" 
ControlToValidate="ddlSomeDropDownList" runat="server" 
ErrorMessage="Must Make a selection"></asp:RequiredFieldValidator> 


"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close