943,522 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 844
  • ASP.NET RSS
May 14th, 2008
0

Sending & Receiving Values

Expand Post »
From form1 I m passing the values of two textboxes & on form 2 I m receiving it---
FORM1 CODE-
asp Syntax (Toggle Plain Text)
  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--
asp Syntax (Toggle Plain Text)
  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
Reputation Points: 0
Solved Threads: 8
Posting Whiz
sonia sardana is offline Offline
326 posts
since Mar 2008
May 14th, 2008
0

Re: Sending & Receiving Values

Hi again Sonia. What is your error message?
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
May 14th, 2008
0

Re: Sending & Receiving Values

Try removing the .ToString part of your Form 2 code like this :

asp Syntax (Toggle Plain Text)
  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.
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
May 15th, 2008
0

Re: Sending & Receiving Values

ASP Syntax (Toggle Plain Text)
  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--

ASP Syntax (Toggle Plain Text)
  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
Reputation Points: 0
Solved Threads: 8
Posting Whiz
sonia sardana is offline Offline
326 posts
since Mar 2008
May 15th, 2008
0

Re: Sending & Receiving Values

Please use code tags, it looks very untidy without them, with regards to the 2nd label not showing have you sorted this yet?
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
May 17th, 2008
1

Re: Sending & Receiving Values

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.
Reputation Points: 10
Solved Threads: 9
Junior Poster
sierrainfo is offline Offline
144 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: String connection
Next Thread in ASP.NET Forum Timeline: Simple DropDownLisT Example





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC