Sei sulla pagina 1di 2

Difference between Assembly And NameSpace An Assembly can contain many namespaces,an assembly is a file that contains all

deployment and version information for a program.it is an output unit assembly also allow side by side execution.two version of same assembly can be u sed at the same time. an assembly is composed of four section: manifest ->which contain a information about assembly such as name of assembly , version number type metadata->data type used by the program. Program code->which is stored in msil format. Resource->used by the program. Namespace is used in order to avoid conflict of user define classes, they form logical boundray for a group of classes. namespace must be specified in project properties. State management in asp.net=> View state is used to maintaing the state of control or page during postback.it allows state of the objects to be store in a hidden fields on the page "EnableViewState" :- It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the cli ents browser. When the page is posted back to the server the server control is r ecreated with the state stored in viewstate. Server side is the code that resides at web server. For every client request code is executed at server side and result is send to t he client in simple HTML format. Performance is lower than client side code due to server round trips. Client cannot see the business logic though it is stored on server. Client Side Code Client side code is reside at client's browser itself. It is executed at client side only. User can easily see the code by View - > Source option. It is generally used in validation form like text field is empty or not, email a ddress validation etc. It is faster than server side code. server.transfer work on those site running on the server.you can't use it to tra nsfer the user to external site. Server.Transfer() helps the one less round trip. The main advantage of this tran sfer the first page to second page with better performance. The data can pass th rough variables, query string and also can retrive from the previous page contro l value. It is very similar to server.Transfer. The main difference is the posted perviou s page values can't be accessable. Response.Redirect should be used when: we want to redirect the request to some plain HTML pages on our server or to some other web server we don't care about causing additional roundtrips to the server on each requ est we do not need to preserve Query String and Form Variables from the original request we want our users to be able to see the new redirected URL where he is redir ected in his browser (and be able to bookmark it if its necessary) Server.Transfer should be used when:

we want to transfer current page request to another .aspx page on the same s erver we want to preserve server resources and avoid the unnecessary roundtrips to the server we want to preserve Query String and Form Variables (optionally) we don't need to show the real URL where we redirected the request in the us ers Web Browser

Potrebbero piacerti anche