How to open a popup on button submit (asp net mvc 2.0)

i am using asp net mvc 2.0

How to open a popup on button submit with some database fields.

Well i am having a subit button on page.Onve i click on submit its open a
popup with some database field like user name and thank you message.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Since you are capturing user action via popup, you will most likely use client side scripting to get the user input. Once you get the user input, you can set it to some control in your form which will get sent to your server when the form is submitted.

Here’s an expmple…
.aspx page:-
 <form id="form1" runat="server">
      <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="HiddenField1.value = prompt('Enter your feedback','');" />
      <asp:HiddenField ID="HiddenField1" runat="server" /> 
      <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Open in new window

This code handles the user input on the server side. (In this case, it simply displays it in a label, but at this point you get to decide what to do with it.)

.cs page:-

  protected void Page_Load(object sender, EventArgs e) {
       if(IsPostBack) {
      Label1.Text = HiddenField1.Value;   }

Open in new window

The button has a client script calling the prompt function. The value returned by the prompt function is set to the value of the hidden field, which gets submitted to the server.

An alternative method is shown in the following article:-
nicemanishAuthor Commented:
well in asp net mvc 2.0 server control is not allowed.need to do with someting jquery in asp net mvc

here "XXXXX " fields come from database or class
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
another link which might be helpful:-
Ok this is what I would do in this case (I try to not use popups as they usually are source of trouble with browsers, pop-up blockers, etc...).

If I want to open a popup I build an <a> tag with target="_blank" into my code (it could surround your button)

Your <a> tag will open an url, so you'll need a method on your controllers that shows the info you're seeking to put on the popup and a view that fits with it. Then you only need to put into your <a> tag href attribute the url to call this controller method.
Also if you don't like to use an <a> tag you always can attach a javascript function to your button and use inside it to open the popup and redirect it to the controller's url.
Alpesh PatelAssistant ConsultantCommented:
Hi you can use AJAX Popup extender control to do this
nicemanishAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Frameworks

From novice to tech pro — start learning today.