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. Read from HTML TextFiled (Client Side)

Read from HTML TextFiled (Client Side)

Scheduled Pinned Locked Moved ASP.NET
htmlsysadmintutorialquestion
6 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.
  • M Offline
    M Offline
    maro18
    wrote on last edited by
    #1

    Hi Everyone How to pass a value from an HTML Textfiled (client side) to TextBox (Server Side)?????:confused: Thanks

    A T 4 Replies Last reply
    0
    • M maro18

      Hi Everyone How to pass a value from an HTML Textfiled (client side) to TextBox (Server Side)?????:confused: Thanks

      A Offline
      A Offline
      Andrew Quinn AUS
      wrote on last edited by
      #2

      Hi, Are you talking about from an <INPUT type='text'> to an asp:textbox ?? If so why not just make the <INPUT type='text'> a server control, e.g.

      <INPUT type='text' id='myTextbox' runat='server' name='myTextbox' value=''/>

      and then declare it at the server-side...

      protected System.Web.UI.HtmlControls.HtmlInputText myTextbox;
      ...
      ...
      ...
      ...

      Hope this helps, Andy

      1 Reply Last reply
      0
      • M maro18

        Hi Everyone How to pass a value from an HTML Textfiled (client side) to TextBox (Server Side)?????:confused: Thanks

        T Offline
        T Offline
        Tuwing Sabado
        wrote on last edited by
        #3

        Hi Please follow the instruction for passing the value of HTML object to a server side object 1st Step; add runat=server attribute to HTML object you want to access in code behind ex. 2nd Step; Declare the HTML Control object in code behind ex. Public Class MyPage1 Protected WithEvents WebControlTxtbox As System.Web.UI.WebControls.TextBox Protected WithEvents HtmlControlTxtbox As System.Web.UI.HtmlControls.HtmlInputText Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ..... End Sub End Class 3rd Step; Set the value of HtmlControlTxtbox to WebControlTxtbox ex. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WebControlTxtbox.Text = HtmlControlTxtbox.Value End Sub Happy Coding Mark

        M 1 Reply Last reply
        0
        • M maro18

          Hi Everyone How to pass a value from an HTML Textfiled (client side) to TextBox (Server Side)?????:confused: Thanks

          T Offline
          T Offline
          Tuwing Sabado
          wrote on last edited by
          #4

          By the way you can do this in a simplest way if you want by controlling this in a dynamic script. ex. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load page.registerstartupscript("MyScript1","ServerControlTxtbox.value = HTMLControlTxtBox.value") End Sub Hi But if you want

          1 Reply Last reply
          0
          • M maro18

            Hi Everyone How to pass a value from an HTML Textfiled (client side) to TextBox (Server Side)?????:confused: Thanks

            T Offline
            T Offline
            Tuwing Sabado
            wrote on last edited by
            #5

            By the way you can do this in a simplest way if you want by controlling this in a dynamic script. ex. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load page.registerstartupscript("MyScript1","ServerControlTxtbox.value = HTMLControlTxtBox.value") End Sub Happy Coding Mark Hi But if you want

            1 Reply Last reply
            0
            • T Tuwing Sabado

              Hi Please follow the instruction for passing the value of HTML object to a server side object 1st Step; add runat=server attribute to HTML object you want to access in code behind ex. 2nd Step; Declare the HTML Control object in code behind ex. Public Class MyPage1 Protected WithEvents WebControlTxtbox As System.Web.UI.WebControls.TextBox Protected WithEvents HtmlControlTxtbox As System.Web.UI.HtmlControls.HtmlInputText Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ..... End Sub End Class 3rd Step; Set the value of HtmlControlTxtbox to WebControlTxtbox ex. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WebControlTxtbox.Text = HtmlControlTxtbox.Value End Sub Happy Coding Mark

              M Offline
              M Offline
              maro18
              wrote on last edited by
              #6

              Thx Mark, its really help :)

              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