Browsed by
Tag: Rapid Fire on ASP.NET

In which event of page cycle is the ViewState available?

In which event of page cycle is the ViewState available?

After the Init() and before the Page_Load(). In ASP.NET, the ViewState is available in the Load event of the page life cycle. This event occurs after the Init event and before the PreRender event. Therefore, any data stored in the ViewState can be accessed or manipulated during the Load event.

How can we prevent browser from caching an ASPX page?

How can we prevent browser from caching an ASPX page?

We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property: Response.Cache.SetNoStore (); Response.Write (DateTime.Now.ToLongTimeString ()); To prevent a browser from caching an ASPX page in ASP.NET, you can utilize various methods. Here are a few common approaches: Setting Cache Control Headers: You can set cache control headers in the response to instruct the browser not to cache the page or to revalidate it on each request. You can achieve this in the code-behind file of your ASPX…

Read More Read More

How we can force all the validation controls to run?

How we can force all the validation controls to run?

The Page.Validate() method is used to force all the validation controls to run and to perform validation. In ASP.NET, to force all validation controls to run, you can call the Page.Validate() method. This method validates all of the validation controls on the page, regardless of whether their Enabled property is set to true or false. After calling Page.Validate(), you can check the Page.IsValid property to determine if all the validation controls passed validation. Here’s a sample code snippet demonstrating this:…

Read More Read More

ASP.NET is open-source. Explain

ASP.NET is open-source. Explain

Microsoft is providing the full .NET server stack in open source which means it is a ‘free’ download. This includes ASP.NET, the .NET compiler, the .NET Core Runtime, Framework, and Libraries, enabling developers to build with .NET across Windows, Mac or Linux. When discussing ASP.NET being open-source in an interview context, you can provide the following explanation: ASP.NET is indeed open-source, which means that its source code is freely available for anyone to view, modify, and distribute under licenses that…

Read More Read More

What are the types of Authentication in ASP.NET?

What are the types of Authentication in ASP.NET?

There are three types of authentication available in ASP.NET: Windows Authentication: This authentication method uses built-in Windows security features to authenticate a user. Forms Authentication: Authenticates against a customized list of users or users in a database. Passport Authentication: Validates against Microsoft Passport service which is basically a centralized authentication service. In ASP.NET, there are primarily three types of authentication mechanisms: Windows Authentication: This method relies on Windows accounts for authenticating users. Users’ credentials are verified against the Windows user…

Read More Read More

What are the data controls available in ASP.NET?

What are the data controls available in ASP.NET?

The Controls having DataSource Property are called Data Controls in ASP.NET. ASP.NET allows a powerful feature of data binding, you can bind any server control to simple properties, collections, expressions and/or methods. When you use data binding, you have more flexibility when you use data from a database or other means. Data Bind controls are container controls. Controls -> Child Control Data Binding is binding controls to data from databases. With data binding we can bind a control to a…

Read More Read More

From which base class all Web Forms are inherited?

From which base class all Web Forms are inherited?

Page class. In ASP.NET, all web forms are inherited from the System.Web.UI.Page class. This class provides the fundamental framework for handling web requests and rendering HTML output. It contains methods and properties that are essential for managing the lifecycle of a web page, handling events, and interacting with the server-side code.

What is the good practice to implement validations in aspx page?

What is the good practice to implement validations in aspx page?

Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources. In ASP.NET, implementing validations in an ASPX page can be achieved using various techniques and controls provided by the framework. Here are some good practices for implementing validations: Use Validation Controls: ASP.NET provides built-in validation controls such as RequiredFieldValidator, RegularExpressionValidator, RangeValidator, etc. These controls are easy to use and provide client-side and server-side validation without writing custom code….

Read More Read More

List all templates of the Repeater control

List all templates of the Repeater control

ItemTemplate AlternatingltemTemplate SeparatorTemplate HeaderTemplate FooterTemplate In ASP.NET, the Repeater control is used to display a repeated list of items from a data source. It provides great flexibility in defining the layout of the repeated items. Here are the templates associated with the Repeater control: ItemTemplate: This template is used to define the layout of each item in the Repeater control. AlternatingItemTemplate: Similar to ItemTemplate, but this template is applied to every other item in the Repeater control. It’s useful for…

Read More Read More

Explain the request flow in ASP.NET MVC framework.

Explain the request flow in ASP.NET MVC framework.

Request flow handles the request from the clients and passes it to the server. Request hits the controller coming from the client. Controller plays its role and decides which model to use in order to serve the request further, passing that model to view which then transforms the model and generates an appropriate response that is rendered to the client.