What is the difference between web.config and Machine.config files?
1. Usually on a webserver there is only one Machine.config file whereas in a web application there is no of files,but in the root directory.
2. Web.config file settings will override machine.config settings.
3. Machine.config file specifies configuration settings for all of the websites on the web server.Web.config file specify configuration settings for a particular web application, and is located in the applications root directory .Reply
What is the main difference between the Button server control and the Button HTML control?
Differences between Web and Windows applications?
Web Forms:Web forms use server controls, HTML controls, user controls, or custom controls created specially for Web forms.Web applications are displayed in a browser.Web forms are instantiated on the server, sent to the browser, and destroyed immediately.
Windows Forms:Windows forms are instantiated, exist for as long as needed, and are destroyed. Windows applications run on the same machine they are displayed on.Windows applications display their own windows and have more control over how those windows are displayed.
Describe the property of cookie in Asp.Net ?
1. Domain: The domain associated with the cookie for example, aspx.superexpert.com
2. Expires: The expiration date for a persistent cookie.
3. HasKeys: A Boolean value that indicates whether the cookie is a cookie dictionary.
4. Name: The name of the cookie.
5. Path: The path associated with the Cookie. The default value is /.
6. Secure: A value that indicates whether the cookie should be sent over an encrypted connection only. The default value is False.
7. Value: The value of the Cookie.
8. Values: A NameValueCollection that represents all the key and value pairs stored in a Cookie dictionary.
Write the code that creates a cookie containing the user name R4R and the current date to the user computer. Set the cookie to remain on the user computer for 30 days?
HttpCookie cookUserInfo = new HttpCookie("UserInfo");
CookUserInfo["Name"] = "R4R";
CookUserInfo["Time"] = DateTime.Now.ToString();
cookUserInfo.Expires = DateTime.Now.AddDays(30);
"HttpCookie" :The HttpCookie class is under System.Web namespace.
"CookUserInfo" :is the object of class HttpCookie
"Expires": is the property that sets the duration,when cookie expire.Reply
What do you mean by three-tier architecture?
The three-tier architecture was improve management of code and contents and to improve the performance of the web based applications. There are mainly three layers in three-tier architecture.This architecture remove the many drawbacks of previous Cliet-Server architecture.
There are three stages in this Architecture;
(2)Business Logic Layer:BL(Business Logic Layer) contain the server side code for data transaction, query and communicate through Data Base,and Pass the data to the user interface.
(3)Database layer:Data Layer represents the data store like MS Access, SQL Server, an XML file, an Excel file or even a text file containing data also some additional database are also added to that layers.
Define ASP.Net page life cycle in brief ?
1. OnInit (Init): Initializes each child control.
2. LoadControlState: Loaded the ControlState of the control. To use this method the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.
3. LoadViewState: Loaded the ViewState of the control.
4. LoadPostData: Controls that implement this interface use this method to retrieve the incoming form data and update the control According to there properties.
5. Load (OnLoad): Allows actions that are common to every request to be placed here. control is stable at this time, it has been initialized and its state has been reconstructed.
6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler.
7. RaisePostbackEvent: Handling the clien side event caused Postback to occur
8. PreRender (OnPreRender): Allows last-minute changes to the control. This event takes place before saving ViewState so any changes made here are saved.
9. SaveControlState: Saves the current control state to ViewState.
10. SaveViewState: Saves the current data state of the control to ViewState.
11. Render: Generates the client-side HTML Dynamic Hypertext Markup Language (DHTML) and script that are necessary to properly display this control at the browser. In this stage any changes to the control are not persisted into
12. Dispose: Accepts cleanup code. Releases any unman-aged resources in this stage. Unmanaged resources are resources that are not handled by the .NET common language runtime such as file handles and database connections.
What is ViewState?
State of the object to be stored in hidden field on the page.ViewState is not stored on the server or any other external source. ViewState transported to the client and back to the server. ViewState is used the retain the state of server-side objects between postabacks.Viewstate should be the first choice to save data to access across postbacks.
Do Web controls support Cascading Style Sheets?
All Web controls inherit a property named CssClass from the base class "System.Web.UI. WebControls. WebControl" which can be used to control the properties of the web control.
What is Data Binding?
Data Binding is binding controls to data from databases.Using Data binding a control to a particular column in a table from the database or we can bind the whole table to the data grid.
In other words Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.