Oct
23
2012
ASP.NET // C#

Get html input text values in asp.net C# code behind

Here is how to get html input text values with out having runat="server" from asp.net c# code behind.   Example:   Front-end (.aspx) page: <input type="text" id="text1" name="text1" /> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />   Back-end (.aspx.cs) page:  protected void Button1_Click(object sender, EventArgs e) { string getTextValues = Request["text1"].Trim();  }    OR: protected void Button1_Click(object sender, EventArgs e) { string getTextValues = Page.Request.Form["text1"].ToString();  }

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar