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. Data Binding to textbox

Data Binding to textbox

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netwpfwcf
3 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.
  • F Offline
    F Offline
    For_IT
    wrote on last edited by
    #1

    Hi how can I bind the data to textbox using ASP.NET inline coding? I have implemented data binding to dropdownlist... likewise I want to do data binding to TextBox too.. can someone please guide me? Thanks in advance.

    M P 2 Replies Last reply
    0
    • F For_IT

      Hi how can I bind the data to textbox using ASP.NET inline coding? I have implemented data binding to dropdownlist... likewise I want to do data binding to TextBox too.. can someone please guide me? Thanks in advance.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, You should remember that the TextBox does not have the DataSource or DataSourceID properties as the DropDownList, however you can use the data binding expression to bind to the Text property of the TextBox. It looks something like:

      <asp:TextBox runat="server" ID="TextBox1" Text="<%# your expression goes here %>" />

      and you need to call the DataBind method.

      1 Reply Last reply
      0
      • F For_IT

        Hi how can I bind the data to textbox using ASP.NET inline coding? I have implemented data binding to dropdownlist... likewise I want to do data binding to TextBox too.. can someone please guide me? Thanks in advance.

        P Offline
        P Offline
        postmaster programmingknowledge com
        wrote on last edited by
        #3

        While dr.Read lblID.Text = dr("ID") txtJobName.Text = dr("JobName") txtJobDescription.Text = dr("JobDescription") End While Find the example at http://www.programmingknowledge.com/simpleDataGrid.aspx[^]

        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