Click here to Skip to main content
15,890,282 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: HOW TO UPLOAD/ RETREIVE MUSIC FILE USING ASP.NET Pin
mnaveed5-Jul-06 23:43
mnaveed5-Jul-06 23:43 
QuestionProblem in retrieving the email id from active directory [modified] Pin
wilssmith5-Jul-06 22:29
wilssmith5-Jul-06 22:29 
AnswerRe: Problem in retrieving the email id from active directory Pin
Paddy Boyd6-Jul-06 0:21
Paddy Boyd6-Jul-06 0:21 
Questionexport my site to a web server Pin
y_mmohd5-Jul-06 22:09
y_mmohd5-Jul-06 22:09 
Questionserver.transfer vs response.redirect Pin
lavanya_satheesh5-Jul-06 22:05
lavanya_satheesh5-Jul-06 22:05 
AnswerRe: server.transfer vs response.redirect Pin
_AK_5-Jul-06 22:10
_AK_5-Jul-06 22:10 
AnswerRe: server.transfer vs response.redirect Pin
Tirthadip5-Jul-06 22:16
Tirthadip5-Jul-06 22:16 
AnswerRe: server.transfer vs response.redirect Pin
Vipin Venugopal5-Jul-06 22:44
Vipin Venugopal5-Jul-06 22:44 
Using Querystring
Querystring is a day old mechanism to pass values across pages. The main advantage of this method is it is very simple. However, disadvantages are the values are visible in the browser address bar and you can not pass objects this way. This method is best suited when you want to pass small number of values that need not be secured from others. In order to implement this method you will follow these steps:
§ Create the web form with controls
§ Provide some button or link button that posts the form back
§ In the click event of the button create a string that holds URL for another
§ Add control values to this URL as querystring parameters
§ Response.Redirect to another form with this URL
Following code snippet shows how it works:
Source Web Form
private void Button1_Click
(object sender, System.EventArgs e)
{
string url;
url="anotherwebform.aspx?name=" +
TextBox1.Text + "&email=" +
TextBox2.Text;
Response.Redirect(url);
}
Destination Web Form
private void Page_Load
(object sender, System.EventArgs e)
{
Label1.Text=Request.QueryString["name"];
Label2.Text=Request.QueryString["email"];
}



Server.Transfer
This is yet another way to pass values across pages. Here you store control values in session variables and access them in another web form. However, as you know storing too much data in session can be an overhead on the server. So, you should use this method with care. Also, it requires some kind of clean up action from your side so that unwanted session variables are removed. The typical sequence of steps will be as follows:
§ Create the web form with controls
§ Provide some button or link button that posts the form back
§ In the click event of the button add session variables and set them to control values
§ Response.Redirect to another form
§ In that form access Session variables and remove them if necessary
Following code shows this in action:
Source Web Form
private void Button1_Click
(object sender, System.EventArgs e)
{
//textbox1 and textbox2 are webform
//controls
Session["name"]=TextBox1.Text;
Session["email"]=TextBox2.Text;
Server.Transfer("anotherwebform.aspx");
}
Destination Web Form
private void Page_Load
(object sender, System.EventArgs e)
{
Label1.Text=Session["name"].ToString();
Label2.Text=Session["email"].ToString();
Session.Remove("name");
Session.Remove("email");
}
QuestionCan we bind datareader to textboxes? Pin
lavanya_satheesh5-Jul-06 22:03
lavanya_satheesh5-Jul-06 22:03 
AnswerRe: Can we bind datareader to textboxes? Pin
Tirthadip5-Jul-06 22:37
Tirthadip5-Jul-06 22:37 
AnswerRe: Can we bind datareader to textboxes? Pin
mnaveed5-Jul-06 22:37
mnaveed5-Jul-06 22:37 
GeneralRe: Can we bind datareader to textboxes? Pin
Tirthadip5-Jul-06 23:25
Tirthadip5-Jul-06 23:25 
GeneralRe: Can we bind datareader to textboxes? Pin
mnaveed5-Jul-06 23:38
mnaveed5-Jul-06 23:38 
GeneralRe: Can we bind datareader to textboxes? Pin
Tirthadip5-Jul-06 23:50
Tirthadip5-Jul-06 23:50 
GeneralRe: Can we bind datareader to textboxes? Pin
mnaveed6-Jul-06 1:08
mnaveed6-Jul-06 1:08 
QuestionHow can we use DataViewManager to bind data to a datagrid in asp.net? Pin
lavanya_satheesh5-Jul-06 22:00
lavanya_satheesh5-Jul-06 22:00 
AnswerRe: How can we use DataViewManager to bind data to a datagrid in asp.net? Pin
mnaveed5-Jul-06 22:35
mnaveed5-Jul-06 22:35 
GeneralRe: How can we use DataViewManager to bind data to a datagrid in asp.net? Pin
lavanya_satheesh7-Jul-06 20:29
lavanya_satheesh7-Jul-06 20:29 
Questioncatching return value from javascript function in asp.net code behind Pin
sandeep kumar pundhir5-Jul-06 21:39
sandeep kumar pundhir5-Jul-06 21:39 
AnswerRe: catching return value from javascript function in asp.net code behind Pin
DIMPLE_R5-Jul-06 21:53
DIMPLE_R5-Jul-06 21:53 
QuestionObjectDataSource does not display valid BLL classes from BIN folder Pin
zrrbite5-Jul-06 21:16
zrrbite5-Jul-06 21:16 
AnswerRe: ObjectDataSource does not display valid BLL classes from BIN folder Pin
minhpc_bk5-Jul-06 22:30
minhpc_bk5-Jul-06 22:30 
GeneralRe: ObjectDataSource does not display valid BLL classes from BIN folder [modified] Pin
zrrbite5-Jul-06 23:09
zrrbite5-Jul-06 23:09 
GeneralRe: ObjectDataSource does not display valid BLL classes from BIN folder Pin
minhpc_bk5-Jul-06 23:41
minhpc_bk5-Jul-06 23:41 
GeneralRe: ObjectDataSource does not display valid BLL classes from BIN folder Pin
zrrbite5-Jul-06 23:53
zrrbite5-Jul-06 23:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.