Tuesday, April 1, 2008

ASP.NET Technical Interveiw Latest Questions 2

  1. How do you specify whether your data should be passed as Query string and Forms (Mainly about POST and GET)
    Through attribute tag of form tag.

  2. What is the other method, other than GET and POST, in ASP.NET?

  3. What are validator? Name the Validation controls in asp.net? How do u disable them? Will the asp.net validators run in server side or client side? How do you do Client-side validation in .Net? How to disable validator control by client side JavaScript?
    A set of server controls included with ASP.NET that test user input in HTML and Web server controls for programmer-defined requirements. Validation controls perform input checking in server code. If the user is working with a browser that supports DHTML, the validation controls can also perform validation ("EnableClientScript" property set to true/false) using client script.
    The following validation controls are available in asp.net:
    RequiredFieldValidator Control, CompareValidator Control, RangeValidator Control, RegularExpressionValidator Control, CustomValidator Control, ValidationSummary Control.

  4. Which two properties are there on every validation control?
    ControlToValidate, ErrorMessage

  5. How do you use css in asp.net? "Asp.net questions asked in leading it companies technical interviews MNCs for 2008 free with solutions / answers
    Within the section of an HTML document that will use these styles, add a link to this external CSS style sheet that
    follows this form:

    MyStyles.css is the name of your external CSS style sheet.

  6. How do you implement postback with a text box? What is postback and usestate?
    Make AutoPostBack property to true

  7. How can you debug an ASP page, without touching the code?

  8. What is SQL injection?
    An SQL injection attack "injects" or manipulates SQL code by adding unexpected SQL to a query.
    Many web pages take parameters from web user, and make SQL query to the database. Take for instance when a user login, web page that user name and password and make SQL query to the database to check if a user has valid name and password.
    Username: ' or 1=1 ---
    Password: [Empty]
    This would execute the following query against the users table:
    select count(*) from users where userName='' or 1=1 --' and userPass=''

  9. How can u handle Exceptions in Asp.Net?

  10. How can u handle Un Managed Code Exceptions in ASP.Net?

  11. Asp.net - How to find last error which occurred?
    A:
    Server.GetLastError();
    [C#]
    Exception LastError;
    String ErrMessage;
    LastError = Server.GetLastError();
    if (LastError != null)
    ErrMessage = LastError.Message;
    else
    ErrMessage = "No Errors";
    Response.Write("Last Error = " + ErrMessage);

    1. How to do Caching in ASP? "Latest asp net tech / hr interview question
      A: <%@ OutputCache Duration="60" VaryByParam="None" %>
    1. VaryByParam value

    Description

    none

    One version of page cached (only raw GET)

    *

    n versions of page cached based on query string and/or POST body

    v1

    n versions of page cached based on value of v1 variable in query string or POST body

    v1;v2

    n versions of page cached based on value of v1 and v2 variables in query string or POST body

    1. <%@ OutputCache Duration="60" VaryByParam="none" %>
      <%@ OutputCache Duration="60" VaryByParam="*" %>
      <%@ OutputCache Duration="60" VaryByParam="name;age" %>
      The OutputCache directive supports several other cache varying options
    2. VaryByHeader - maintain separate cache entry for header string changes (UserAgent, UserLanguage, etc.)

    • VaryByControl - for user controls, maintain separate cache entry for properties of a user control

    • VaryByCustom - can specify separate cache entries for browser types and version or provide a custom GetVaryByCustomString method in HttpApplicationderived class

    1. What is the Global ASA(X) File? "ASP.net technical Interview questions"

    2. Any alternative to avoid name collisions other then Namespaces.
      A scenario that two namespaces named N1 and N2 are there both having the same class say A. now in another class i ve written
      using N1;using N2;
      and i am instantiating class A in this class. Then how will u avoid name collisions?
      Ans: using alias
      Eg:
      using MyAlias = MyCompany.Proj.Nested;

    3. Which is the namespace used to write error message in event Log File?

    4. What are the page level transaction and class level transaction?

    5. What are different transaction options?

    6. What is the namespace for encryption?

    7. What is the difference between application and cache variables?

    8. What is the difference between control and component?

    9. You ve defined one page_load event in aspx page and same page_load event in code behind how will prog run?

    10. Where would you use an IHttpModule, and what are the limitations of any approach you might take in implementing one?

    11. Can you edit data in the Repeater control? Which template must you provide, in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

    12. What is the use of web.config? Difference between machine.config and Web.config?
      ASP.NET configuration files are XML-based text files--each named web.config--that can appear in any directory on an ASP.NET
      Web application server. Each web.config file applies configuration settings to the directory it is located in and to all
      virtual child directories beneath it. Settings in child directories can optionally override or modify settings specified in
      parent directories. The root configuration file--WinNT\Microsoft.NET\Framework\\config\machine.config--provides
      default configuration settings for the entire machine. ASP.NET configures IIS to prevent direct browser access to web.config
      files to ensure that their values cannot become public (attempts to access them will cause ASP.NET to return 403: Access
      Forbidden).
      At run time ASP.NET uses these web.config configuration files to hierarchically compute a unique collection of settings for
      each incoming URL target request (these settings are calculated only once and then cached across subsequent requests; ASP.NET
      automatically watches for file changes and will invalidate the cache if any of the configuration files change).
      http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx

    13. What is the use of sessionstate tag in the web.config file? - "asp net tutorials, guide, free questions and answers, programs questions download online instantaneously
      Configuring session state: Session state features can be configured via the section in a web.config file. To double the default timeout of 20 minutes, you can add the following to the web.config file of an application:
      timeout="40"
      />

    1. What are the different modes for the sessionstates in the web.config file?
    1. Off

    Indicates that session state is not enabled.

    Inproc

    Indicates that session state is stored locally.

    StateServer

    Indicates that session state is stored on a remote server.

    SQLServer

    Indicates that session state is stored on the SQL Server.

    1. What is smart navigation?
      When a page is requested by an Internet Explorer 5 browser, or later, smart navigation enhances the user's experience of the page by performing the following:
    2. eliminating the flash caused by navigation.

    • persisting the scroll position when moving from page to page.

    • persisting element focus between navigations.

    • retaining only the last page state in the browser's history.

    1. Smart navigation is best used with ASP.NET pages that require frequent postbacks but with visual content that does not change dramatically on return. Consider this carefully when deciding whether to set this property to true.
      Set the SmartNavigation attribute to true in the @ Page directive in the .aspx file. When the page is requested, the dynamically generated class sets this property.
    2. In what order do the events of an ASPX page execute. As a developer is it important to undertsand these events?

    3. How would you get ASP.NET running in Apache web servers - why would you even do this?

    4. What tags do you need to add within the asp:datagrid tags to bind columns manually

    5. What base class do all Web Forms inherit from?
      System.Web.UI.Page

    6. How can we create pie chart in asp.net?

    7. Is it possible for me to change my aspx file extension to some other name?
      Yes.
      Open IIS->Default Website -> Properties
      Select HomeDirectory tab
      Click on configuration button
      Click on add. Enter aspnet_isapi details (C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll GET,HEAD,POST,DEBUG)

      Open machine.config(C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\CONFIG) & add new extension under tag

    8. What is AutoEventWireup attribute for ?

    No comments: