User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,417 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,689 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 365 | Replies: 5
Reply
Join Date: Mar 2008
Posts: 119
Reputation: sonia sardana is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
sonia sardana sonia sardana is offline Offline
Junior Poster

Sending & Receiving Values

  #1  
May 14th, 2008
From form1 I m passing the values of two textboxes & on form 2 I m receiving it---
FORM1 CODE-
  1. protected void Button1_Click(object sender, EventArgs e)
  2. {
  3.  
  4. Response.Redirect("default4.aspx?roll="+TextBox1.Text);
  5. Response.Redirect("default4.aspx?name="+TextBox2.Text);
  6. }

FORM2 CODE--
  1. protected void Page_Load(object sender, EventArgs e)
  2. {
  3. Label1.Text = Request.QueryString["roll"].ToString();
  4. Label2.Text = Request.QueryString["name"].ToString();
  5. }

But the error is coming
Last edited by peter_budo : May 14th, 2008 at 3:30 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Sending & Receiving Values

  #2  
May 14th, 2008
Hi again Sonia. What is your error message?
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Sending & Receiving Values

  #3  
May 14th, 2008
Try removing the .ToString part of your Form 2 code like this :

  1. FORM2 CODE--
  2. protected void Page_Load(object sender, EventArgs e)
  3. {
  4. Label1.Text = Request.QueryString["roll"];
  5. Label2.Text = Request.QueryString["name"];
  6. }

I think this will help, let me know how you get on...
Last edited by majestic0110 : May 14th, 2008 at 3:37 pm.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Mar 2008
Posts: 119
Reputation: sonia sardana is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
sonia sardana sonia sardana is offline Offline
Junior Poster

Re: Sending & Receiving Values

  #4  
May 15th, 2008
  1. protected void Button1_Click(object sender, EventArgs e)
  2. {
  3.  
  4. Response.Redirect("default4.aspx?roll="+TextBox1.Text);
  5. Response.Redirect("default4.aspx?name="+TextBox2.Text);
  6. }
FORM2 CODE--

  1. protected void Page_Load(object sender, EventArgs e)
  2. {
  3. Label1.Text = Request.QueryString["roll"];
  4. Label2.Text = Request.QueryString["name"];
  5. }

On Form2 Only the value of first textbox is displayed,value of second textbox is not displayed
Last edited by peter_budo : May 15th, 2008 at 4:25 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Sending & Receiving Values

  #5  
May 15th, 2008
Please use code tags, it looks very untidy without them, with regards to the 2nd label not showing have you sorted this yet?
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: May 2008
Location: India
Posts: 66
Reputation: sierrainfo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
sierrainfo sierrainfo is offline Offline
Junior Poster in Training

Re: Sending & Receiving Values

  #6  
May 17th, 2008
The problem is that you are using 2 Response.Redirects. Use this code to append both values to the same Querystring:

Response.Redirect("default4.aspx?roll="+TextBox1.Text + "&"+"name="+TextBox2.Text);
Then retrieve the values in the Label as you have done.

Regards
Sunil Punjabi
<URL Snipped>
Last edited by peter_budo : May 18th, 2008 at 4:26 am. Reason: Keep It Organized - please use [code] tags + Keep It Spam-Free - Do not spam, advertise, plug your website, or engage in any other type of self promotion.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 1:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC