Sending & Receiving Values

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Sending & Receiving Values

 
0
  #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 4:30 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Sending & Receiving Values

 
0
  #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 Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Sending & Receiving Values

 
0
  #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 4: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 Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: Sending & Receiving Values

 
0
  #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 5:25 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Sending & Receiving Values

 
0
  #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 Quick reply to this message  
Join Date: May 2008
Posts: 144
Reputation: sierrainfo is an unknown quantity at this point 
Solved Threads: 9
sierrainfo sierrainfo is offline Offline
Junior Poster

Re: Sending & Receiving Values

 
1
  #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 5: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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC