Breaking News

Editors Picks

Sunday, June 20, 2010

ASP.NET interview Question- Part3

1. Difference between Const and readonly?
  • const cannot be static, readonly can be static.
  • Evaluation of the values of const  is done during design time.
  • A const required to be declared and initialized during declaration.

2. How can you show the number of visitors of your app?
    By making use of the application variable and increment the counter beginning of each session.
Session start and Application_start event can be used.


3. What are the navigation controls available with asp.net?
 Navigation controls available are
 Tree views
 Site Maps
 Menus
   
4. Which two properties on validation control?
  The common properties available in every validation control are
  Error Message
  Control to validate

5. Which method do you use to redirect the user to another page without performing a round trip to the client?
  Server. Transfer can be used to redirect the user directly to another page without any round trip to the client.

6. What is web.config file?
   Web.config is the configuration file for ASP.NET application. There is one web.config file in asp.net application which configures 
the particular application. Web.config file is written in XML with specific tags having specific meanings.It includes data which includes 
connections,Session States,Error Handling,Security etc.

7. What are the various ways of securing a web site that could prevent from hacking?
      Various ways of securing the web sites from hackers are as follows:-
         Encryption/ Decryption
         Authentication
         Authorization
         Maintaining the server inside corporate firewall

8. What are the different types of directives in .NET?
    Different types of directives are as follows:-
    @Control
    @Page
    @Assembly
    @Register
    @OutputCache
    @Import
    @Reference
        
9. What is Page Directive?
   Defines page-specific attributes used by the ASP.NET page parser and compiler. Can be included only in .aspx files and also define the page language used just like c#,VB etc.  

10. How to customize the Appearance of SiteMapPath web server controls?
    The appearance can be customized by setting the attributes of the control alse by configuring the templates which are available for the control.

11. What is PostBack?
    The process that sends the web page data back to the server of the same page is called PostBack.

12. What is the code to remove all the items from the session?
    Session.Contents.RemoveAll() is the code used to remove all the items from the seesion.


13. What is Reference Directive?
    Declaratively indicates that another user control or page source file should be dynamically compiled and linked against the page in which this directive is declared.


14. Can you add title to the browser history point?
    Yes, it is possible to add title in the browser history point.

15. Can you display image with hyperlink field of gridview?
   
   
   
   

   


16. What is CauseValidation Property in ASP.NET?
    CausesValidation property determines whether validation must be performed on button click or not, if asp.net validation control are used. It can be either true or false. By default it is true. It is mostly used for Cancel/Reset button, where we don't want to perform any kind of validations.


17. Can you access controls placed in master page in content page?
    It is possible to access control in Master page. FindControl method is used for Master Page Class.

18. What are the parts of Master Page?
    Master Page consist of three parts:-
    1. The area for Master Page content 
    2. Area for the child Page, which is replace by child pages content.


19. Tel us the different ways to apply CSS in web page?
    Three different ways to apply CSS are
    1. Create a style sheet file and define all your styles and just provide the reference of the style sheet page in the head section using link tag. 
    2. Define style in head element of your page and use that styles in your page. 
    3. Define style inline. Inline style means add style attribute to particular HTML element.

20. What should be done to avoid Script Injection?
    Steps to be followed to avoid Script Injection:-
    Restrict the user from entering <, >  as input character.
    Encode the input before storing.  

Read more ...

ASP.NET Interview Question Part-2

1) How does the cookies work in asp.net?
    When a cookie is created it will be stored in the user's hard disk. When the user visits a site the next time the browser sends all the cookies to the server.

2) What is the difference between Dataset. clone() and Dataset.copy()?
    Dataset.clone() is to create new instance of the same object. It copies only structure
    Dataset.copy() function helps to copy the content of data without creating instance to another object. It copy both structure and data.

3) Why do we bind the data in Web-application not in the Windows-application?
    Databind converts webserver controls into HTML. Since the browser can understand HTML, java script and css.

4) What is Ispostback method in ASP. Net?
    It is a property that indicates the value whether the page is being loaded in request of the user.

5) How can we use pointers in ASP.Net?
    Pointers can be used in ASP.NET by specifying within the unsafe keyword. Instead of pointers can use reference variable.

6) What is the difference between EVENTS and FUNCTIONS?
    Action done to an object is represented by event. Function represents an action done by the object itself.

7) What are the difference between ASP and ASP.NET?
    * ASP.NET supports OOPS concept whereas ASP is procedure oriented.
    * Late binding presented in ASP.NET
    * ASP does not support disconnected architecture whereas ASP.NET supports.

8) What is the difference between ASP.NET and .NET Remoting?
    ASP.NET can be accessed using HTML while .NET remoting can be accessed using any protocol. ASP.NET is easy to create whereas .NET remoting is a complex program.

9) What is .NET frame work?
   .NET frame work consist of two components:-
    * The common language runtime
    * NET Framework class library .
   .NET framework is an environment provides memory and theory management and also provide platform and language independence.

10) What is CLR?
    CLR stands Common language Runtime. Runtime is to execute the program and not develop it.

11) Is string a value type or a reference type?
     String is reference type, it is commonly misunderstand as value type. This is because since they are immutable it is assumed to be value type.

12)What is the characteristic of string?
    It’s of reference type
    Immutable
    Contains null
    Overloads == operator

13) what is .NET Partial Classes?
    Partial type class is defined using the keyword partial
     We can keep all properties related to Employee in one Employee Partial Class.
     We can keep all Methods related to Employee in one Employee Partial Class.
     We can keep all constants and fields related to Employee in one Employee  
      Partial Class and so on.

14) How we can set Different levels of Authentication in .Net?
    Different levels in authentication are
    ·Form authentication
    ·Window authentication
    ·Passport authentication.

15) How can you provide an alternating color scheme in a Repeater control?
    Alternating color scheme can be used in repeater control using AlternatingItemTemplate.

16) What is Forms authentication?
    Enables you to identify users with a custom database such as an ASP.NET membership database. Alternatively you can implement your own custom database. Once authenticated you can reference the roles the user is in to restrict access to portions of your Web site.

17) How to alter the rows in a datagrid?
    You can use DataGrid's OnItemCreated and OnItemDataBound events. OnItemCreated event is fired once a row is created but the values are not yet binded.
OnItemDataBound will fire for every row that is bounded. You can get the values here for each column in the row. Depending on you requirement you can use either of these events

18) Name two properties common in every validation control?
     Two properties common in every validation control are
     ·ControlToValidate property
     ·Text property

19) How to manage state in ASP.NET?
     Session state, application state and view state is used to manage state in ASP.NET.

20) What does WSDL stand for?
     Web Services Description Language. 

21) Where are the resource files declared?
     Resources file are declared in app_globalresources.

22) How a grid can be made editable int ASP.Net? How to Access a particular cell of Grid?
     to make the grid editable
     public void bind() { string str select * from Customer ; OleDbDataAdapter da new OleDbDataAdapter(str con);
     DataSet ds new DataSet();
     da.Fill(ds); dg.DataSource ds;// this reference is used to identify keys in grid
     dg.DataKeyField CustID ;
     dg.DataBind();
     }

     then create an event for grid!for update edit deleteprivate
 void dg_EditCommand(object source System.Web.UI.WebControls.DataGridCommandEventArgs e) 
{ dg.EditItemIndex e.Item.ItemIndex; bind(); // this value is used to mention the respective row of grid idval dg.DataKeys[(int)e.Item.ItemIndex].ToString(); }

23) What do you mean by authentication and authorization?
       Authentication is the process of validating a user on the credentials (username and password) and authorization performs after authentication. After Authentication a user will be verified for performing the various tasks, It access is limited it is known as authorization.

24)what is the difference between TransferRequest and Transfer method?
   Transfer: Terminates execution of the current page and starts execution of provided URL.
   TransferRequest: Performs an asynchronous execution of the provided URL.

25) what are the different properties of Object Oriented Systems?
     * It supports complex data types
     * inheritance
     * encapsulation of data
     * extensibility of existing data types and classes

Read more ...

ASP.NET Interview Question Part-1

1) What’s a bubbled event?
    The event processing routine for each object in complex control like data grid is very difficult. In such case, can make use of the bubbled event.

2) What data types do the RangeValidator control support?
    The data types supported by rangevalidator are:-
       String
       Integer
       Date

3) What namespace does the Web page belong in the .NET Framework class hierarchy?
     It belongs to System.Web.UI.Page.  

4) What is namespace?
     Namespace avoids the clashes between classes is called namespace. Namespace is a collection of structure, class, interface, delegate and enumeration.

5) What methods are fired during the page load?
       Unload()
       Load()
       PreRender()
       Init()

6)What is the difference between Response.write() and Response.Output.Write
     The major difference is that response.write() doesn’t provide formatted output whereas response.output.write() displays formatted output

7) When during the page processing cycle is viewstate available?
     The ViewState is available a fter the Init() and before the Page_Load(), or OnLoad() for a control.

8) Describe the role of inetinfo.exe, aspnet_isapi.dll and aspnet_wp.exe in the page loading process.
     ASP.NET requests are handled using inetinfo.exe. When an request is received, the isapi file filter the dll and process the request.

9) Explain the differences between Server-side and Client-side code?
     Code on the server side gets executed in the server, in response to the request of any asp page whereas the code in the client side get executed in the client browser.

10) Should user input data validation occur server-side or client-side?  Why?
     Data validation are to be performed both on the server side as well as on the client side inorder for better performance and provide better quality.

11) Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
     Dataset are universal but ADO.NET come in different version for different sources.
     Dataset don’t have the concept of cursor.
     Dataset don’t have current record pointer.

12) What is an assembly?
     Assembly is the building block of the .NET framework.

13) What is the Global.asax used for?
     It is mainly used to implement session level events and implement applications. It is included in the file Global.asax.cs.

14) What are the Application_Start and Session_Start subroutines used for?
      The Application_Start and Session_Start used mainly to set the variables for session and application objects.

15) Explain what a diffgram is, and a good use for one?
      Inorder to render the dataset object into XML the diffgram is used. The main use of the difgram is that reading the data in the database to an XML file which could be sent to web service.

16) Can you edit data in the Repeater control?
      No, it is not possible to edit the data in the repeater control. It is just provide to read the information in the data source.

17) How to display data in a repeater control?
      Item template is used to display the data in a repeater control.

18) What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
      Code behind is common only to visualstudio.net.

19) What is the difference between Server.Transfer and Response.Redirect?  Why would I choose one over the other?
       Server.Transfer function transfers processing of page directly to the next page, and hence provides faster response with little overheads.
       Response.Redirect is to direct to another website or page.

20) How many classes can a single .NET DLL contain?
      It can contain many classes.

21) What is the transport protocol you use to call a Web service?
      The most preferred protocol is SOAP(Simple Object Access Protocol)

22) Describe the difference between inline and code behind?
      Inline code is written along with the HTML page and code behind is written in separate file and referenced by .aspx page.

23) What is page class?
      Page class is a base class which is inherited by all web forms.

24) What are the different types of Session state management options available with ASP.NET?
      The two session state management are:
       In-process state management
       Out process state management.

25) How do you post a current page to different ASPx page?
      ASP.NET redirect to a different page by the following ways:-
     * Hyperlink on pages.
     * Redirecting by making the browser to request a different page.
     * Transferring control to a different page.

Read more ...

Contact Us

Name

Email *

Message *