|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
The mystery of passing form valuesI have a login form on page A which needs to post its values to page B on a
diferent server. Both pages are ASP.NET 2.0. How do I get the values back from the Request object? I assumed that if I had an asp:TextBox with an ID "username" in form A that I would retrieve the value ala Request["username"], but this isn't the case. The keys are all modified strings like "ctl00$ContentPlaceHolder1$username", which I can't search for because I don't know in advance. Do I need to search for the substring in each key name myself? What am I not grasping here?
http://msdn2.microsoft.com/en-us/library/ms178139.aspx
Quote from the above link: "If the source and target page are in different applications, you cannot directly get the values of controls on the page, but you can read the posted data from the Form dictionary. You cannot read view state from the source page, because it is hashed. If you want to store values in the source page and make them available in a target page in another application, you can store the values as strings inside hidden fields on the source page and access them through Request.Form on the target page." You can either copy the content of those textboxes upon losing focus to hidden input objects using JavaScript (as the quote above suggests) or you can search for the substring in each key name as you guessed below. I think both would work. Show quoteHide quote "Joseph Bergevin" wrote: > I have a login form on page A which needs to post its values to page B on a > diferent server. Both pages are ASP.NET 2.0. How do I get the values back > from the Request object? > I assumed that if I had an asp:TextBox with an ID "username" in form A that > I would retrieve the value ala Request["username"], but this isn't the case. > The keys are all modified strings like "ctl00$ContentPlaceHolder1$username", > which I can't search for because I don't know in advance. Do I need to search > for the substring in each key name myself? What am I not grasping here?
new menu control is very slow
Changed property values not reflected in DesignMode Control-level security Highlight row in a gridview after formview insert Blank page after selection PublicKeyToken, GAC registering, and multiple developers?? ASP.Net 2 Two Way Binding and DateTime Format Problem Use Enter as default key Little green arrows Gridview Column Length |
|||||||||||||||||||||||