Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Request.form problem
Message
From
17/03/2008 17:25:10
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
17/03/2008 15:38:44
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01302707
Message ID:
01302818
Views:
6
>>>Hi
>>>
>>>I have a web form searchoptions.aspx with a textbox named TextBox1.
>>>
>>>I call another form using Server.Transfer("Default2.aspx",true)
>>>
>>>In default2.aspx I want to get the value of TextBox1 and am using Request.Form["TextBox1"] but this returns nothing. Request.Form[1] does give me the content of Textbox1.
>>>
>>>Why doesn't Request.Form["TextBox1"] give me what I want.
>>>
>>>Thanks
>>>
>>>Nick
>>
>>Can't you just put the string in a session variable before you navigate away?
>>Session["SearchText"] = Texbox1.Text;
>>
>>Then get it out in your page 2
>>string searchableText = Request.QueryString["SearchText"];
>>
>>Tim
>
>Can do Tim
>
>I was wondering why the other thing didn't work.
>
>I saw it here
>
>http://www.developer.com/net/asp/article.php/3299641
>
>
>
>Nick

Well, I glanced at it and have to say I have never tried this. I don't really like accessing form gui components from an outside source anyway, but I would suspect at a minimum your textbox would have to be publicly declard. I am not sure why in the web environment you would want the static page still around, but I supose there are instances this might make sense. If you are going to do this, it would be better to have a public property that can obtain the value of the textbox.
public string MyTextBoxValue
{
  get
  {
    return this.Textbox1.Text
  }
}
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform