| | |
Sending & Receiving Values
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
From form1 I m passing the values of two textboxes & on form 2 I m receiving it---
FORM1 CODE-
FORM2 CODE--
But the error is coming
FORM1 CODE-
asp Syntax (Toggle Plain Text)
protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("default4.aspx?roll="+TextBox1.Text); Response.Redirect("default4.aspx?name="+TextBox2.Text); }
FORM2 CODE--
asp Syntax (Toggle Plain Text)
protected void Page_Load(object sender, EventArgs e) { Label1.Text = Request.QueryString["roll"].ToString(); Label2.Text = Request.QueryString["name"].ToString(); }
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
Try removing the .ToString part of your Form 2 code like this :
I think this will help, let me know how you get on...
asp Syntax (Toggle Plain Text)
FORM2 CODE-- protected void Page_Load(object sender, EventArgs e) { Label1.Text = Request.QueryString["roll"]; Label2.Text = Request.QueryString["name"]; }
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!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
ASP Syntax (Toggle Plain Text)
protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("default4.aspx?roll="+TextBox1.Text); Response.Redirect("default4.aspx?name="+TextBox2.Text); }
ASP Syntax (Toggle Plain Text)
protected void Page_Load(object sender, EventArgs e) { Label1.Text = Request.QueryString["roll"]; Label2.Text = Request.QueryString["name"]; }
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
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!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
•
•
Join Date: May 2008
Posts: 144
Reputation:
Solved Threads: 9
The problem is that you are using 2 Response.Redirects. Use this code to append both values to the same Querystring:
Then retrieve the values in the Label as you have done.
Regards
Sunil Punjabi
<URL Snipped>
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.
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: String connection
- Next Thread: Simple DropDownLisT Example
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child class click commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu dynamic edit expose feedback flash flv form formatdecimal forms formview gridview homeedition hosting iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 suse textbox tracking typeof unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers






