Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. HTML Text Box

HTML Text Box

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-nethelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sudharsong
    wrote on last edited by
    #1

    hi all, Thanks in advance to you all.i have a html textbox in my asp.net form and i have email id's on that for validation.after finishing the validations i have to send the mails to the id's given in the text box.i want to know way to get the value of textbox to the c# code behind as the mail to send address of my application.please help me. like mail.To="value of the HTML textbox should come here" with regards, susa -- modified at 7:11 Monday 1st May, 2006

    M K 2 Replies Last reply
    0
    • S sudharsong

      hi all, Thanks in advance to you all.i have a html textbox in my asp.net form and i have email id's on that for validation.after finishing the validations i have to send the mails to the id's given in the text box.i want to know way to get the value of textbox to the c# code behind as the mail to send address of my application.please help me. like mail.To="value of the HTML textbox should come here" with regards, susa -- modified at 7:11 Monday 1st May, 2006

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      All server controls have properties. You access a property's value using the syntax: ServerControl.Property The TextBox control has a Text property for retrieving or setting the text in the box. If your TextBox is named "MyTextBox", you would retrieve its value in C# this way:

      string myText = MyTextBox.Text;

      You might benifit from a look at the QuickStart tutorials on http://www.asp.net[^].

      1 Reply Last reply
      0
      • S sudharsong

        hi all, Thanks in advance to you all.i have a html textbox in my asp.net form and i have email id's on that for validation.after finishing the validations i have to send the mails to the id's given in the text box.i want to know way to get the value of textbox to the c# code behind as the mail to send address of my application.please help me. like mail.To="value of the HTML textbox should come here" with regards, susa -- modified at 7:11 Monday 1st May, 2006

        K Offline
        K Offline
        Kanjinghat
        wrote on last edited by
        #3

        To get the value of a HtmlTextBox control from C# code behind, you have to convert the Control to a server control, not a web server control. just click on the control and select "Run as server control". set the ID propety in the preorties window. or you can add 'id="UName" runat="server"' this snippet in the textbox tag in the HTML view. example initially your control looks like the below, <input type="TextBox"> alter it to <input type="TextBox" id="UName" runat="server"> know at the code behinde you can use the below code to get the value System.Web.UI.HtmlInputText txtName = new System.Web.UI.HtmlInputText(); txtName = (System.Web.UI.HtmlInputText)this.FindConrol("UName");//Provide the ID you have given to the cotrol now txtName.Value will give you the textbox value hope this helps you Cheer. Ramesh.Kanjinghat

        S 1 Reply Last reply
        0
        • K Kanjinghat

          To get the value of a HtmlTextBox control from C# code behind, you have to convert the Control to a server control, not a web server control. just click on the control and select "Run as server control". set the ID propety in the preorties window. or you can add 'id="UName" runat="server"' this snippet in the textbox tag in the HTML view. example initially your control looks like the below, <input type="TextBox"> alter it to <input type="TextBox" id="UName" runat="server"> know at the code behinde you can use the below code to get the value System.Web.UI.HtmlInputText txtName = new System.Web.UI.HtmlInputText(); txtName = (System.Web.UI.HtmlInputText)this.FindConrol("UName");//Provide the ID you have given to the cotrol now txtName.Value will give you the textbox value hope this helps you Cheer. Ramesh.Kanjinghat

          S Offline
          S Offline
          sudharsong
          wrote on last edited by
          #4

          hi, thank you ramesh for ur help by sparin ur time ,now i will try it out.i know it will work. sudharson.g with regards, susa

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups