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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. convert querystring value to textbox control id

convert querystring value to textbox control id

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 2 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.
  • J Offline
    J Offline
    janetb99
    wrote on last edited by
    #1

    In vb, what would be the correct syntax to reference a textbox from a passed querystring? The textbox I need to look at is derrived from a querystring parameter, e.g. id=txtAbra or could be id=txtMagic, which is passed as say request("id") string. So, I then need to reference the textbox.value on the page with that querystring value. I don't need the value of the querystring as a value, but as the id of the textbox on the page. If the request("id") = "txtMagic", how do I reference that txtBox value on the page when I come to it? Dim myStr As String = Request("id").toString Dim myVar as string = string.empty myVar=CType(myStr,TextBox).Text Thanks so much, Janet

    J 1 Reply Last reply
    0
    • J janetb99

      In vb, what would be the correct syntax to reference a textbox from a passed querystring? The textbox I need to look at is derrived from a querystring parameter, e.g. id=txtAbra or could be id=txtMagic, which is passed as say request("id") string. So, I then need to reference the textbox.value on the page with that querystring value. I don't need the value of the querystring as a value, but as the id of the textbox on the page. If the request("id") = "txtMagic", how do I reference that txtBox value on the page when I come to it? Dim myStr As String = Request("id").toString Dim myVar as string = string.empty myVar=CType(myStr,TextBox).Text Thanks so much, Janet

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      Page.FindControl[^] However, nore that if the textbox is within another control (such as a Panel) then you'll need to also leverage Control.FindControl[^]

      J 1 Reply Last reply
      0
      • J J4amieC

        Page.FindControl[^] However, nore that if the textbox is within another control (such as a Panel) then you'll need to also leverage Control.FindControl[^]

        J Offline
        J Offline
        janetb99
        wrote on last edited by
        #3

        J4amieC, Thanks so much - a little tweaking and just what I needed. I appreciate your time. Janet

        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