Connecting Tech Pros Worldwide Forums | Help | Site Map

passing value to other page

Newbie
 
Join Date: Feb 2009
Posts: 26
#1: Mar 16 '09
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..

Member
 
Join Date: Feb 2009
Posts: 32
#2: Mar 16 '09

re: passing value to other page


this code is used on that page where you want to value of textbox
Expand|Select|Wrap|Line Numbers
  1. sub page_load()
  2.  
  3.  If Page.IsPostBack = False Then
  4.             Dim txtSearch As TextBox = CType(PreviousPage.FindControl("txtusername"), TextBox)
  5.             Response.Write(txtSearch.Text)
  6.         End If
  7.  
  8. end sub
  9.  
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,125
#3: Mar 16 '09

re: passing value to other page


How are you passing value between the pages?

Are you using Session?

-Frinny
Newbie
 
Join Date: Feb 2009
Posts: 26
#4: Mar 17 '09

re: passing value to other page


hi.......actually i have three panels in first page..first panel contains a dropdownlist which have items as empid,empdesignation,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
kunal pawar's Avatar
Needs Regular Fix
 
Join Date: Oct 2007
Location: Pune, India
Posts: 297
#5: Mar 17 '09

re: passing value to other page


Both pages are different ?

try using Request variable
Newbie
 
Join Date: Jan 2009
Posts: 15
#6: Mar 17 '09

re: passing value to other page


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
Newbie
 
Join Date: Feb 2009
Posts: 26
#7: Mar 18 '09

re: passing value to other page


thanx Blacky for u r help...it's working....
Reply


Similar ASP.NET bytes