Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir I am working on a asp.net application. For sending text box value from one page to another I am using request.querystring() method. But after the page redirection it return null values. here is my code.


C#
protected void btnSavecontinue_Click(object sender, EventArgs e)
{
 cmd.CommandText = "INSERT INTO tbl_healthrecord (sl_no,entry_date,factory_name)values ('" + txtSlno.Text + "','" + txtDateentry.Text + "','" + txtFactoryName.Text + "')";
                cmd.Connection = con;
               cmd.ExecuteNonQuery();
               resettext();
               con.Close();
               Response.Redirect("~/Hypertension .aspx?slno="+txtSlno.Text);
           }
Posted
Updated 23-Feb-14 7:06am
v4
Comments
Thomas Daniels 23-Feb-14 12:08pm    
What's the value of txtFactoryName.Text?
Sandip.Nascar 23-Feb-14 12:15pm    
Inspecting querystring is very easy. Look at the browser url and you will see the querystring values there.

The url will look like
www.yourdomain.com/.../Hypertension .aspx?slno={some value}
Perhaps the value is null and that is why querystring returns null value.
bigyan sahoo 23-Feb-14 13:09pm    
In the insert statement shows all value are available and inserted successfully, but the query string return null value in the url. I want to display the query string value in the next page.
bigyan sahoo 23-Feb-14 13:57pm    
yeah sir. Now i had done it. I 'll call the reset function before query string. thanks for ur help.
Krunal Rohit 23-Feb-14 14:28pm    
How are you accessing that query string on redirected page ?

-KR

1 solution

Hi,

You have called the function 'resettext();' before Response.Redirect.
I think it will clear the textbox content.

Can you please check into 'resettext();' function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900