ASP.NET is a server-side open-source platform developed by Microsoft that is used for developing dynamic web pages and web applications for mobile devices and PCs. ASP.NET is a part of the Microsoft.Net platform and can work along with the HTTP protocol.
ASP.NET provides developers with several advantages:
The ASP framework stands for Active Server Pages, it is a server-side technology where the code is executed by the server. If a web browser makes a request for an ASP file, the file is read via ASP engine and the code is executed. After execution, the result is returned to the browser.
Using the PostBack process, an ASP.NET page can be submitted to the server. This process is used when some credentials in the page like passwords and usernames have to be verified against the original credentials.
This method is performed when the client system is not able to do it and the credentials have to be sent back to the server.
The ViewState is a state management technique that is used for storing the user information of the page during the PostBack process. The ViewState holds the values of the controls but does not restore value to this control after the postback process is finished. This feature is switched on by default even if the page is not used in a postback.
A cookie in ASP.NET is used for storing user information that can be read by the web application if the user visits the site again. If a request for a website is made, then the server responds by sending a cookie file along with the site. They increase search efficiency.
Database connection in ASP.NET can be done in two ways. A data source control is concerned with connecting to the database, selecting the data and caching data. The data view control is used for data manipulation and displaying data. A connection to a database server is also possible by implementing C# code.
A master page is a file having a .master extension that is used for containing HTML, server controls and static text. It provides the placeholders for storing content and templates for forms. If a request for a website made, the layout inside the master's page is combined with content to produce the result.
Steps to bind Drop-Downlist and Gridview in ASP.NET are:
The steps to add background image in asp.net are:
body{ background-image:URL('images/background.png'); } where the background.png is an example of an image that can be used.
An ASP.NET QueryString is a set of characters that are provided to a web browser. It is used when values need to be transferred from one page to another. A QueryString collection is used to store and obtain values of variables in an HTTP query string. A QueryString for HTTP consists of the user search queries followed by a question mark.
Caching is the method of storing frequently used information in the memory so that if that data is needed in future the cache can be accessed to obtain it. At that time the application does not have to generate the data. It improves the performance of the ASP.NET pages as they are dynamically created here.
Variables can be sent between pages in asp.net by the following ways:
The DataBind method is inherited by every ASP.NET webform from the Control class, that gives it the functionality to bind data along with its properties. It is called simple data binding that attaches a collection that implements IEnumerable interface to any control’s DataSource property.
The steps to add bootstrap in ASP.NET are:
Crystal reports in ASP.NET are applications that can create reports from different data sources like XML files and databases. These reports can be used to represent charts, totals and complex reports in other programming languages. The Visual Studio IDE comes with integrated Crystal reports.
The AutoEventWireup is an attribute of the page directive. If it is set to true then the page framework invokes the events of the page directly. It is a Boolean value that depicts whether the page events are autowired. The default value is true.
The Repeater control is a data-bind control that represents a list of items that are control bound. This control may be bound to a database, XML file or some other list of items.
The steps to use a Repeater are:
<connectionStrings><add name="constr" connectionString="initial catalog=puran; data source=MCN002; integrated security=sspi"/></connectionStrings>
To convert an HTML page to an ASP.NET page the contents of the HTML has to be pasted inside the body of the ASPX page. The content of the head section has to be pasted inside the ASPX head section.
The CSS has to be included within a folder inside the ASP project. The <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> has to be added at the top also.
Authentication in ASP.NET is the process of verifying user credentials and authorization is allowing these users to access the resources. Security is the umbrella under which the two actions are performed.
Role-based security is the concept of partitioning the website based on user roles. The user will get access to the resources based on their roles like administrator or guest. It is used when an application needs approval from multiple sources to work.
Validation is a system of checking the user inputs before they are layered into the application to ensure wrong data compromising the working of the application is not sent.
Validation performed on the client browser using JavaScript is called client-side validation.
Validation done at the server is called server-side validation. It is a more secure check than the user side where errors are caught even if the user has bypassed client-side validation.
View State is a Page-Level State Management procedure that preserves the Value of a Page and Control properties during round trips, that is sending a request to server and return of page from the server.
Caching is the process where the output that a page generates is stored in memory, and the saved output or cache allows the page being loaded faster the next time with only the required modifications being applied.
MVC or Model View Controller is a pattern of separating a complete application into three components: Model, View, and Controller. The ASP.NET MVC Framework is a very testable and lightweight presentation framework integrated with ASP.NET features providing complete control over JavaScript, CSS, and HTML, and is better used in applications of a large scale with multiple teams working together.
Session states may be managed in ASP.NET in two ways:
Cookies are small files sent from the server which are saved in the client’s computer by the browser. They are a State Management technique to store user-specific information on the user’s system, enhancing webpage performance.
A: Web config file is specific to the web application, while the machine config is specific to the machine or the server. Thus, there may be many web config files for an application, but only a single machine config file for each server.
A: Role-Based Security is a system for allowing access to specific parts of the application to specific user groups only. Thus an Administrator has greater access than a User, who in turn has greater access than a Guest.
Data is normally posted to the same page when the submit button is clicked on a webpage. Cross Page Posting is the method where the data is submitted to a different page when the submit button is clicked on a webpage.
Boxing is the assignment of a value type variable to a reference type variable, while unboxing is the exact opposite, assignment of a reference type variable to a value type variable.
Strong Typing of the code means the variable data types are checked during compilation hence errors are avoided during runtime. Weak Typing of code checks the data types during runtime itself and hence can cause issues during runtime.
Two types of cookies are used:
AJAX or Asynchronous JavaScript and XML allows asynchronous updating of the webpage so that part of the page may be updated without reloading the entire page every time.
Web Services are software programs that use common protocols to exchange information with other software using XML.
ADO.NET components include Dataset, Data Adaptor, Data Reader, Connection, and Command.
The File Extension for Web Service is .asmx.
The HTTP or Hypertext Transfer Protocol is used to call Web service.
Three kinds of caching are available:
The Attributes property of Server Side Control is used to handle an event.
The Page class is the base class from which all Web Forms are inherited.
No, Web Services support a dataset, but not a data reader.