Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 36740 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > how to do pass Values from one page to another page ...
Reddysankark@Yahoo.Com

how to do pass Values from one page to another page

Replies: 6 | Posted by: Reddysankark@Yahoo.Com on 10/28/2012 | Category: ASP.NET Forums | Views: 1297 | Status: [Member] | Points: 10  


Hi,

I need one coding. if you can submit any government application it goes to another page.In this page it will again ask edit,submit.if you can submit means it will save in server.else you can edit means again editable textbox coming

sankarreddy


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Santhi
Santhi  
Posted on: 10/28/2012 7:11:29 AM
Level: Starter | Status: [Member] | Points: 25

Hi,

you can pass the values through the query string.


Regards,
V. Santhi.

Thanks & Regards,
Santhi .V

Reddysankark@Yahoo.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Denon6
Denon6  
Posted on: 10/28/2012 7:50:07 AM
Level: Starter | Status: [Member] | Points: 25

hi ,
also u can pass values using sessions .

regards

Reddysankark@Yahoo.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Jayakumars
Jayakumars  
Posted on: 10/28/2012 9:05:41 AM
Level: Bronze | Status: [Member] | Points: 25

hi
Reddysankark

try this code

First Page Code

Client Side Code

<form id="form1" runat="server">
<asp:TextBox ID="txt1" runat ="server" ></asp:TextBox>
<asp:Button ID="bt1" runat ="server" Text ="Submit" onclick="bt1_Click" />
</form>


Server Side Code

protected void Page_Load(object sender, EventArgs e)
{
string st1 = Request.QueryString["Name"];
if (st1 != "")
{
Response.Write("Page1" + st1);
}
}
protected void bt1_Click(object sender, EventArgs e)
{
Response.Redirect("Page200.aspx?Name=" + txt1.Text);
}
}




Second Page Client Side Code

<form id="form1" runat="server">
<asp:TextBox ID="txt1" runat ="server" ></asp:TextBox>
<asp:Button ID="bt1" runat ="server" Text ="Submit" onclick="bt1_Click" />
</form>


Second Page Server Side Code

protected void Page_Load(object sender, EventArgs e)
{
string st1 = Request.QueryString["Name"].ToString();
if (st1 != "")
{
Response.Write("Page1" + st1);
}

}
protected void bt1_Click(object sender, EventArgs e)
{
Response.Redirect("Page100.aspx?Ename=" + txt1.Text);
}


Mark as Answer if its helpful to you

Regards
Email Id: kumaraspcode2009@gmail.com

Reddysankark@Yahoo.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Rickeybglr
Rickeybglr  
Posted on: 10/29/2012 4:44:14 AM
Level: Starter | Status: [Member] | Points: 25

best way is to use session or query string

Reddysankark@Yahoo.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Deepraj
Deepraj  
Posted on: 10/29/2012 5:50:34 AM
Level: Starter | Status: [Member] | Points: 25

Hi,
There are two ways
1) Passing values using QueryString as illustrated by Jayakumars
2)Using Session this is simple.
For Example:- Consider two pages one.aspx and two.aspx
In one.aspx .cs write
Session["name of ur choice"]=Whatever value you like to pass. i.e Session["myname"]=30.
In two.aspx .cs access it
as Session["myname"].ToString() gives value 30

Passing values using Session is very secure.


Reddysankark@Yahoo.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sourabh07
Sourabh07  
Posted on: 10/29/2012 6:10:07 AM
Level: Starter | Status: [Member] | Points: 25

hi to all..

I think the best way to pass the value is through Session because according to my perspective, it can destroy accordingly and hide from the end user.
But in case of Query String we need to encrypt the value if want to hide from the end user.

Sourabh07

Reddysankark@Yahoo.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/20/2013 5:57:30 AM