How to prefill a form with post data in ASP.NET
I need to populate a form in the main page which on being submitted opens a lightbox which contains another form .
I was p开发者_开发百科lanning to submit the form using Post as that seems to be the only way I can define which iframe to open in the lightbox .However my question is that how do I pre-populate the second form with the first forms data when I use the submission as POST
I am using ASP.NET and C#
I apologize for the naive question but I am still playing around with ASP.NET
We dont have many details on items such as - is there a redirect? whats the second form? how are you handling controls.. etc
Check this out to start. If you really need to send values across separate requests there are various ways to do this, but specify if this is what you are trying to do.
http://msdn.microsoft.com/en-us/library/ms178139.aspx
Use the Form
collection in the Request
object on the second form. The name in the collection is the same as the name in the name/value pair you're using in the post.
TextBox1.Text = Request.Form["someName1"];
TextBox2.Text = Request.Form["someName2"];
Etc.
精彩评论