Difference between server.Execute and response.redirect ?

Answers were Sorted based on User's Feedback



Difference between server.Execute and response.redirect ?..

Answer / ram

Response.Redirect redirects from one page to other page with
roundtrip

Server.Execute method can be used after the page processing
is started, allowing the programmer to choose which page to
execute depending on user input.

http://www.interview-questions.maxmice.com

Is This Answer Correct ?    11 Yes 0 No

Difference between server.Execute and response.redirect ?..

Answer / jalaja

Server.execute combines the results of 2 pages into 1 page.
It is normally used when the second page does not have
controls which trigger postback events.

Response.redirect is used to redirect to another page from
the first page

Is This Answer Correct ?    11 Yes 2 No

Difference between server.Execute and response.redirect ?..

Answer / zohaib shahid

u can also use the Server.Execute method to post ur form
data to the next page on which u are going, or on which u
have mentioned the action

Is This Answer Correct ?    8 Yes 3 No

Difference between server.Execute and response.redirect ?..

Answer / manish kumar

Response.Redirect method :--------
it helps in navigating to another page from code. This is like clicking a hyperlink.To navigate from one page to another using button click or linkbutton control or from server side code use Response Object's Redirect method.
using Response.rediect() method u can not get information from source page on target page.
its source code is like
VB.Net Code
Private Sub Button1_Click(ByVal Sender as System.Object, ByVal e as System.EventArgs) Handles Button1.Click
'Display target page.
Response.Redirect("Target.aspx")
End Sub
C# Code
private void Button1_Click(Object sender, System.EventArgs e)
{
//Display Target Page.
Response.Redirect("Target.aspx");
}
Using Server.Execute Method
use Server.Execute Method to process a Target web form without leaving the Source page. This technique let you embed the result from a target page to a region on Source page. Like Server.Transfer, It also required EnableViewStateMac attribute to page directive set to false.
Suppose I have to pages one is Calculate.aspx havinf two textboxes and a button control. On button Click event. I performed Server.Execute to Result.aspx another aspx page.
Source Code
protected void btn_Click(object sender, EventArgs e)
{
Server.Execute("Result.aspx");
}
Result.aspx page pageload event.

protected void Page_Load(object sender, EventArgs e)
{
NameValueCollection colform = new NameValueCollection();
colform = Request.Form;
Response.Write("<h2>Additon Result:</h2>" + (Convert.ToInt32(colform["TextBox1"]) + Convert.ToInt32(colform["TextBox2"])));
}

If any Mistake then suggest me...plz

Is This Answer Correct ?    3 Yes 0 No

Difference between server.Execute and response.redirect ?..

Answer / shashi singh

server.execute method can be used go from one page to
another page while response.redirect redirects from one
site to another site.

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More ASP.NET Interview Questions

What are the advantages of the code-behind feature?

0 Answers  


Types of authentications in ASP.NET ?

9 Answers   Accenture, Roland, Shriram,


What data type does the RangeValidator control support?

3 Answers   Visual Soft,


which one is more flexibility and reliability and durability asp.net (VS)php which one is best and which one we do nice to create dynamic websites

0 Answers   TCS,


when i want to use asp.net configuration for creat users and roles i recived this message: There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. The following message may help in diagnosing the problem: Unable to connect to SQL Server database. when i clicked the choose data source button that give me another message that is this: Use this page to configure how Web site management data such as membership is stored. You can use a single provider for all the management data for your site or you can specify a different provider for each feature. Your application is currently configured to use the provider: AspNetSqlProvider Select a single provider for all site management data Select a different provider for each feature (advanced) ------------------------- and this message was reapeted in other choose again. please help me if u know why i gave that message so i wont can creat my users and roles

0 Answers  






What is difference between asp state management and asp.net state management? How can we pass info between 2 asp.net pages?

0 Answers  


Which tab of the web site administration tool do you use to manage application setting ,debug and tracing?

2 Answers  


What is use of Master Page in ASP.NET web pages?

0 Answers   Sans Pareil IT Services,


What is the difference between Server.Transfer and Response.Redirect?

5 Answers  


What are the differences between clr & cts?

0 Answers  


WHAT ARE DEFFERENCE BETWEEN DATALIST AND DATAGRID

1 Answers   Seion Infotech,


Which authentication uses a combination of windows and iis authentication?

0 Answers  


Categories