passing value to other page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ria12
    New Member
    • Feb 2009
    • 26

    passing value to other page

    hi....i have trouble in passing values of textboxes to next page.There are 3 textboxes in previous page and i have to pass values to next page bases of textbox selected in prevoius page, next page fill a grid view.....plz help me..
  • bhupinder
    New Member
    • Feb 2009
    • 32

    #2
    Please use
    Code:
     ...
    tags

    this code is used on that page where you want to value of textbox
    Code:
    sub page_load()
    
     If Page.IsPostBack = False Then
                Dim txtSearch As TextBox = CType(PreviousPage.FindControl("txtusername"), TextBox)
                Response.Write(txtSearch.Text)
            End If
           
    end sub
    Last edited by tlhintoq; Mar 16 '09, 02:58 PM. Reason: Please use [CODE] ... [/CODE] tags

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      How are you passing value between the pages?

      Are you using Session?

      -Frinny

      Comment

      • Ria12
        New Member
        • Feb 2009
        • 26

        #4
        hi.......actual ly i have three panels in first page..first panel contains a dropdownlist which have items as empid,empdesign ation,when i select from ddlist an empid,second panel is visible= true.I have to enter empid value of id on buton click that is used on second page to fill a Gridview.same with designation and so on......query string select only one value..not able to choose which value passed from previous page...plz Help me

        Comment

        • kunal pawar
          Contributor
          • Oct 2007
          • 297

          #5
          Both pages are different ?

          try using Request variable

          Comment

          • Blacky
            New Member
            • Jan 2009
            • 40

            #6
            Try this...

            Assign the textbox values to session in first page,

            Session["txtbox1"] = txtbox1.text;
            Session["txtbox2"] = txtbox2.text;
            Session["txtbox3"] = txtbox3.text;


            Take these Session values in your second page, for further processing,

            label1.text = Session["txtbox1"] .Tostring();

            Regards,
            Blacky

            Comment

            • Ria12
              New Member
              • Feb 2009
              • 26

              #7
              thanx Blacky for u r help...it's working....

              Comment

              Working...