ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
When we are requesting a new URL through Response.Redirect()
 the new page wil open on the new browser window or it wil 
open in the same window? If we use Server.Transfer() what 
wil happen?
 Question Submitted By :: Kathiravan_g
I also faced this Question!!     Rank Answer Posted By  
 
  Re: When we are requesting a new URL through Response.Redirect() the new page wil open on the new browser window or it wil open in the same window? If we use Server.Transfer() what wil happen?
Answer
# 1
In Both case Same window will open.
I have written the detail diff between two....
.......................................
Server.Transfer vs Response.Redirect:

A common misconception is the difference between
Server.Transfer and Response.Redirect in ASP.NET
applications. Redirect and Transfer both cause a new page to
be processed, but the interaction between the client (web
browser) and server (ASP.NET) is different in each situation.

Redirect: A redirect is just a suggestion – it’s like saying
to the client “Hey, you might want to look at this”. All you
tell the client is the new URL to look at, and if they
comply, they do a second request for the new URL.

If you want to pass state from the source page to the new
page, you have to pass it either on the URL (such as a
database key, or message string), or you can store it in the
Session object (caveat: there may be more than one browser
window, and they’ll all use the same session object).

e.g. Redirect to the page1.aspx page, passing an ID on the
query string. "true" stops processing the current page:

Response.Redirect("page1.aspx?id=100", true);




Transfer: A transfer happens without the client knowing –
it’s the equivalent of a client requesting one page, but
being given another. As far as the client knows, they are
still visiting the original URL.

Sharing state between pages is much easier using
Server.Transfer – you can put values into the Context.Items
dictionary, which is similar to Session and Application,
except that it lasts only for the current request. (search
for HttpContext in MSDN). The page receiving postback can
process data, store values in the Context, and then Transfer
to a page that uses the values.

e.g. Store a message in the context dictionary, and transfer
to the page2.aspx page (which can then display the message):

Context.Items["Message"] = "Your information was changed
successfully";
Server.Transfer("page2.aspx");




Caveats:

    * Response.Redirect is more user-friendly, as the site
visitor can bookmark the page that they are redirected to.
    * Transferred pages appear to the client as a different
url than they really are. This means that things like
relative links / image paths may not work if you transfer to
a page from a different directory.
    * Server.Transfer has an optional parameter to pass the
form data to the new page.
    * Since the release version, this no longer works,
because the Viewstate now has more security by default (The
EnableViewStateMac defaults to true), so the new page isn’t
able to access the form data. You can still access the
values of the original page in the new page, by requesting
the original handler:
 
Is This Answer Correct ?    0 Yes 0 No
Maloy.adhikari
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
Which method do you invoke on the DataAdapter control to load your generated dataset with data?  1
how to convert from sql2000 numeric to int in asp.net with sqlparameter?  1
how to update data using store procedure  1
Could u send me the answer for this question as soon as possible. Im using 'System.net.mail.mailmessage' namespace for sending a mail from my application. What should I mention in 'system.net.mail.mailmessage.to' property and What should I mention in 'system.net.mail.mailmessage.from' property.  1
How does SQL Server session state works Emphasis1
Types of objects in ASP? Microsoft5
can i use store procedure in disconnected mode? give me answer  2
What is a Repeater Control and how does it works? and what is the diffrence b/w Gridview,datalist and repeater control? USi2
What are the different methods that are used during the page load?  1
when to use webservice and when to use remotong diff between them  3
How to write unmanaged code and how to identify whether the code is managed / unmanaged ? Accenture1
I am having four text boxes in my web application. I am setting Required Field validator to each Text box. And I am having two buttons in my application. If i clicked the first button only first two text box validation will get fire. Dont show error message for remaining two text box. If i clicked second button last two text box validation will get fired. It will not consider the first two validation controls. That is how to enable and disable the validation controls.  4
What is the purpose of each of the validation controls provided by ASP.NET?  1
What is an Interface and What is an Abstract Class?  3
what is the differance between .DLL & .EXE Infinite-Computer-Solutions8
I have one .Net application and i have two databases which is in SQL server2000 and one more database in ORACLE? how can i access the database from different Databases? eXensys3
What are PDBs? Where must they be located for debugging to work?  2
How cross page posting is done in Asp.net 2.0?  3
what is purpose of xml control in standard controls of asp.net  1
1. What is the difference between Cache and Session? 2. I cache limited to page like viewstate or it's accessible through out the application like session? 3. Which one is better when I've some data that is to be used across the application? Why is to better than the other? 247Customer1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com