Asp.Net Interview Questions (Part-2)
Which is the parent class of the Web server control?
The System.Web.UI.Control class is the parent class for all Web server control.Why do we need nested master pages in a Web site?
When we have several hierarchical levels in a Web site, then we use nested master pages in the Web site.
How can you dynamically add user controls to a page?
It is possible to load User Controls onto a page by making use of the LoadControl method.How can you implement the postback property of an ASP.NET control?
A post back is round trip from the client (Browser) to the server and then back to the client. You need to set the AutoPostBack property to True to implement the PostBack property of controls.What are the Navigations technique in ASP.NET?
- Response.Redirect
- Server.Transfer
- Server.Exceute
- Cross page posting
What is a round trip?
A round trip is the event generated onto a control which goes back to a server and executes the required process. When performing Response.Redirect it first sends the request for the new page to the browser (HTTP 302 Found) then browser sends the request for the new page to the webserver (HTTP 200 Ok) then after your page changes. But in case of Server.Transfer it directly communicate with the server to change the page hence it saves a roundtrip in the whole process.What is WebParts in ASP.NET?
Web Parts is an integrated set of controls for creating Web sites that enable end users to modify the content, appearance, and behaviour of Web pages directly from a browser. Web Parts are included in ASP.NET server control framework and are used like any other ASP.NET server controls. You can use any existing ASP.NET control as a Web Parts control, including standard Web server controls, custom server controls, and user controls.Can I deploy the application without deploying the source code on the server?
Yes. You can deploy the asp.net application without deploying the source code on the server by Deploy the compiled version. You can use the aspnet_compiler.exe to precompile a site. This process builds each page in your web application into a single application DLL and some placeholder files. These files can then be deployed to the server.How can you display all validation messages in one control?
You can use the ValidationSummary control to displays all validation messages in one control. It is possible to set the HeaderText to something like "(*) Fields are required" to your validation summary.Which method is used to 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.How can I show the entire validation error message in a message box on the client side?
In validation summary set "ShowMessageBox" to true.What is ValidationSummary?
ValidationSummary control allow us to display summary of all validation errors. You can control whether the ValidationSummary control is displayed or hidden by setting the ShowSummary property. The summary can also be displayed in a message box by setting the ShowMessageBox property to true. If you don't assign a value to the Text property, then the value of the ErrorMessage property is displayed in both the ValidationSummary control and the body of the page.What data type does the RangeValidator control support?
- Currency
- Date
- Double
- Integer
- String
Which control will you use to ensure that the values in two different controls match?
CompareValidator. It compares the value entered by the user in an input control with the value entered in another input control.
What is the difference between a HyperLink control and a LinkButton control?
Hyperlink control is an HTML control , whenever it is clicked the page navigates to the target page. ASP.NET Link Button control is a server control, whenever the user clicks on it, the request is redirected back to the server and in its response the page is navigated to the target page.What does the Orientation property do in a Menu control?
Use the Orientation property to specify the direction in which to render the Menu control. Orientation enumeration have two possible values Horizontal and Vertical. Orientation property value Horizontal indicate the menu control is rendered horizontally and Orientation property value Vertical specify the menu control is rendered vertically.How information about the user's locale can be accessed?
The information regarding a user's locale can be accessed by using the System.Web.UI.Page.Culture property.How do you sign out from forms authentication?
The method FormsAuthentication.SignOut() is used for sign out from forms authentication.What is a multilingual website?
A multilingual website is a website that provides content in more than one language, for example, English, Chinese and German. Multilingual sites can exist in different forms. A site might offer language selection and then present the content in only a single language at a time.What is the difference between a default skin and a named skin?
A default skin automatically applies to all controls of the same type when a theme is applied to a page. While a named skin not automatically apply to controls by type. Instead, you explicitly apply a named skin to a control by setting the control's SkinID property.What are the different validators in ASP.NET?
- RequiredFieldValidator
- RangeValidator
- CompareValidator
- RegularExpressionValidator
- CustomValidator
- ValidationSummary
Which protocol is used to call a Web service?
Simple Object Access Protocol (SOAP) is the preferred protocol. SOAP defines the XML-based message format that Web service-enabled applications use to communicate and inter-operate with each other over the Web.What is the file extension of web service?
ASMX (.asmx) is extension for Webservices.
How do you register JavaScript for webcontrols ?
You can register javascript for controls using
In which event are the controls fully loaded?
Page_Load event.
Controls are also accessed in Page_Init events but view state is not fully loaded during this event.What is side-by-side execution?
ASP.NET applications are said to be running side by side when they are installed on the same computer, but use different versions of the .NET Framework . It is the ability to run multiple versions of an application or component on the same computer. You can have multiple versions of the common language runtime , and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time.What is ASP.NET membership?
ASP.NET membership gives you a built-in way to validate and store user credentials. With this facility, any user can establish an account with the site, and sign in for exclusive access to the site and its services.
Why to use "runat=server" for HTML element?
The "runat=server" attribute basically tells ASP.Net that it needs to parse the element, its attributes and it's contents as a server control. Some controls have explicit implementations, others simply revert to a generic control implementation.Differentiate between file-based dependency and key-based dependency
File-based dependency facilitates you to save the dependency on a file in a disk. We can set the dependency to multiple files also. On such cases, the dependency should be built from an array of files or directories.
In key-based dependency , you depend on another cached item. This is useful when we have multiple interrelated objects in the cache and if one of the objects changes, we need to updated or expire all of them.What is meant by runtime hosts?
The runtime host loads the runtime into a process, creates the application domains within the process, and loads user code into the application domains. Each type of application requires a runtime host to start it. For ASP.Net , runtime hosts loads the runtime that can handle a web request into the process. ASP.NET also creates an application domain for each Web application that will run on a Web server.What is the use of @ Output Cache directive in ASP.NET?
Output caching enables you to store rendered HTML. The stored HTML is served in response to subsequent requests for the same page. Output caching can be a performance benefit to a page that is expensive to run. Once it is cached, future requests will be served from the cache without the page having to run again.What is WSDL?
A WSDL is an XML document that describes a web service. It actually stands for Web Services Definition Language. It is a way to describe services and how they should be bound to specific network addresses. It descibes the contract between service & client. WSDL has three parts:- Definitions
- Operations
- Service bindings
What is a formatter?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.Can we add code files of different languages in App_Code folder?
Yes. Create two subfolders inside the App_Code and then add both C# and VB.NET in the respective subfolders. You also have to add a web.config file to your web site and add the following markup to it:How does the user code initialize?
The user code initialize by using the Page.Load event in the stage of processing of a page. This event always sets off no matter if the page is being requested for the first time or part of a postback.What is the default authentication mode for IIS?
Anonymous is the default authentication mode for IIS.
Which objects is used to create foreign key between tables?
DataRelation
Can a dll run as stand alone application ?
You can't run dll at all. You can create exe and add your dll as a reference.
What is the extension of a web user control file ?
The file name extension for the user control is .ascx.
What is the use of @ Register directives?
@Register directive provides information to the complier about any custom control added to page.
example- Asp.Net Interview Questions (Part-1)
- Advantages of ASP.NET Web Development
- What is IIS - Internet Information Server
- What is Virtual Directory
- What is HttpHandler
- Page Directives in Asp.Net
- What is a postback
- What is IsPostBack
- What is global.asax
- Difference between Machine.config and web.config
- Difference between HTML control and Web Server control
- What is Query String
- Difference between Authentication and Authorization
- How to secure Connection Strings
- What is ASP.Net tracing
- Passing values between Asp.Net pages
- Differentiate between client side validation and server side validation
- How to Get host domain from URL
- Adding a Favicon To Your Website
- Asp.Net Textbox value in Javascript
- AutoEventWireup attribute in ASP.NET
- Can I use multiple programming languages in a ASP.net Web Application?
- Difference: Response.Write and Response.Output.Write
- How many web.config files can I have in an application?
- What is Protected Configuration in asp.net?
- Static variables, what is their life span?
- Difference between ASP Session and ASP.NET Session?
- What does mean Stateless?
- What is the Difference between session and caching?
- What are different types of caching using cache object of ASP.NET?
- Which method is used to remove the cache object?
- How many types of Cookies are available in ASP.NET?
- What is Page Life Cycle in ASP.net?
- What is the code behind and Inline Code in Asp.Net?
- What is master page in ASP.NET?
- Can you change a Master Page dynamically at runtime?
- What is cross-page posting in ASP.NET?
- How to redirect a page in asp.net without performing a round trip ?
- How to register custom server control on ASP.NET page?
- How do you validate Input data in Asp.Net?
- What's the difference between ViewData and ViewBag?
- Difference between Response.Redirect and Server.Transfer
- What is the function of the CustomValidator control?
- Define RequiredFieldValidator?
- Difference between custom control and user control
- Difference between Label and Literal control in ASP.Net
- What are the major events in Global.Asax file?
- What is Event Bubbling in asp.net ?
- What is Delay signing?
- What is the difference between in-proc and out-of-proc?
- What is the difference between POST and GET?
- A potentially dangerous Request.Form value was detected from the client