locked
get html textbox value in C#.net(code behind) RRS feed

  • Question

  • User-177494935 posted

      i am new to ASP.net. Can anybody say how to get Input textbox value in C#.net.

    b4 sending answer 

    Thankx

    Friday, September 19, 2008 1:08 AM

Answers

  • User-292928630 posted

     string value = Resquest.Form["textboxname"].ToString();

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 19, 2008 5:00 AM
  • User-712407825 posted

    Hi,

    There are two ways to access it.

    1) Make it runat="server" and access it in code behind like textbox1.value

    2) Another way is by using

        Request.Form["textbox1"].ToString();

    I hope this will be helpful to you.

    Thanks, 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 19, 2008 5:12 AM
  • User576516345 posted

    just add runat =server to html 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 19, 2008 6:17 AM

All replies

  • User-292928630 posted

     string value = Resquest.Form["textboxname"].ToString();

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 19, 2008 5:00 AM
  • User-712407825 posted

    Hi,

    There are two ways to access it.

    1) Make it runat="server" and access it in code behind like textbox1.value

    2) Another way is by using

        Request.Form["textbox1"].ToString();

    I hope this will be helpful to you.

    Thanks, 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 19, 2008 5:12 AM
  • User576516345 posted

    just add runat =server to html 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 19, 2008 6:17 AM