Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Dylan Bouchard   on Aug 04 In Asp.net Category.

  
Question Answered By: Anselma Schmidt   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>


Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 


Tagged: