Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

send a value from one text box to another form using request.form method

  Asked By: Dylan    Date: Aug 04    Category: Asp.net    Views: 2338
  

i want to send a value from one text box to another form using request.form method

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Sherrie Thomas     Answered On: Aug 04

Two ways:

1. You can process a text  field on same page, look at:
www.learnasp.com/.../pageeventmodel.aspx

2. If you want to send  the value to a different page just place this doe in a button:
response.redirect("otherpage.aspx?" & request("QUERY_STRING"))

 
Answer #2    Answered By: Anselma Schmidt     Answered On: Aug 04

asp.NET adds bits to your controls id

check this out


int loop1;
NameValueCollection coll;

//Load form  variables into NameValueCollection variable.
coll = Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Form: " + arr1[loop1] + "||||" + Request.Form[arr1[loop1]].ToString() + "<br>");
}
if (Page.IsPostBack)
{
try
{
bod = Request.Form["_ctl1:EmailBody"].ToString();// Note you cannot just Request.Form["EmailBody"]
}
catch (Exception ex){}
}

Then an aspx page with
<asp:TextBox id="EmailBody" runat="server"></asp:TextBox>


 




Tagged: