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. General Programming
  3. Visual Basic
  4. pass the value

pass the value

Scheduled Pinned Locked Moved Visual Basic
2 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.
  • M Offline
    M Offline
    Manik Nath
    wrote on last edited by
    #1

    hi all, i want to pass the text of a textbox in one webform to the text property of a label in another webfor, in the same web application. can anyone tell me. ow it can be done. thanks in advance.

    O 1 Reply Last reply
    0
    • M Manik Nath

      hi all, i want to pass the text of a textbox in one webform to the text property of a label in another webfor, in the same web application. can anyone tell me. ow it can be done. thanks in advance.

      O Offline
      O Offline
      oykica
      wrote on last edited by
      #2

      The easiest way is to store the required value in Session State. WebForm1 Session("MyValue") = FromTextBox.Text WebForm2 If Not Session("MyValue") Is Nothing Then ToLabel.Text = Session("MyValue") End If You could also get the ViewState information from the original WebForm by using the Server.Transfer method. This method requires that the EnableViewStateMac attribute of the WebForm be set to False so that the ViewState is not hashed. WebForm1 Server.Transfer("WebForm2.aspx", True) WebForm2 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim fromForm As System.Collections.Specialized.NameValueCollection fromForm = Request.Form ToLabel.Text = fromForm.Item("FromTextBox") End Sub

      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