473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Sending & Receiving Values

From form1 I m passing the values of two textboxes & on form 2 I m receiving it---
FORM1 CODE-
protected void Button1_Click(object sender, EventArgs e)
{

Response.Redirect("default4.aspx?roll="+TextBox1.T ext);
Response.Redirect("default4.aspx?name="+TextBox2.T ext);
}

FORM2 CODE--
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
May 14 '08 #1
2 984
Hi,

Try this:

Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(String.Format("default4.aspx?roll={0}&name={1}", TextBox1.Text, TextBox2.Text));
And what exception do you received? Probably it is a "Null reference exception".
May 15 '08 #2
daonho
18
Response.Redirect("default4.aspx?roll="+TextBox1.T ext);
Response.Redirect("default4.aspx?name="+TextBox2.T ext);
}

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

====
Response.Redirect("default4.aspx?name="+TextBox2.T ext);

I don't know if the 2nd response.redirect ever be reached. During the first response.redirect, it move to a different page already, and you pass only 1 parameter at a time, but in the 2nd form you try to catch two parameters.

Response.Redirect("default4.aspx?name="+TextBox2.T ext + "&roll="+TexBox1.Text); //this is how you pass multiple parameters
try{
Label1.Text = Request.QueryString["roll"].ToString();
}
catch exception e
{
}
try{
Label2.Text = Request.QueryString["name"].ToString();
}
catch exception e {


}
May 15 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chuck Marques | last post by:
I'm trying to implement sending an object through messaging, but I receive an error stating I can't deserialize the object. Any clues as to why. I have the following: <Serializable()> Public...
1
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and...
3
by: Robert A. van Ginkel | last post by:
Hello Fellow Developer, I use the System.Net.Sockets to send/receive data (no tcpclient/tcplistener), I made a receivethread in my wrapper, the receivethread loops/sleeps while waiting for data...
1
by: Sajsal | last post by:
Hi all I am developing a web app in which the client wants an email sending and receiving functionality. Is it possible in C#. If yes where should I start. If anyone could tell that how long...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
2
by: Marcelo | last post by:
Hi guys, I'm using the following code to send values from one page to another, but seems to me, that the event Page_Load in the receiving page never fires. Why? This is the code: Thanks ...
6
by: cj | last post by:
I'm receiving an xml formatted string that I pull data from by reading it into an xml document like this: Dim doc As New Xml.XmlDocument doc.LoadXml(respstr) Dim co_name As Xml.XmlNodeList =...
9
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.