ASP.NET Interview Questions




{
  "iq":[{"id":"1",
    "q":" What is ASP.Net? Why asp.net?",
    "answer":" ASP.NET is a .NET web technology or Server side technology./n/tWHY: To develop a web application by using .Net we have to use a .Net web technology called Asp.Net and a .Net language called C#.Net.    "
  },
    {"id":"2",
      "q":"What do you mean by server side technology? ",
      "answer":"1. The code which is executing within the WEB SERVER is called as SERVER SIDE CODE.\n2. Server side code we can implement by using Server side technologies.\nEx. ASP, ASP.NET, JSP, PHP and so on\n3. Using server side technology we can develop server side web pages.   "
    },
    {"id":"3",
      "q":" What do you mean by client side technology?",
      "answer":"1. The code which is executing within the WEB BROWSER is called as CLIENT SIDE CODE.\n2. Client side code we can implement by using client side technologies.\n3. Ex: JavaScript, HTML, CSS"
    },

    {"id":"4",
      "q":"  What are the programming techniques will be supporting by  asp.net?",

      "answer":" Asp.net will support 2 Programming Techniques. They are- \n1. InPage Technique and\n2. CodeBehing Technique.  "
    },
    {"id":"5",
      "q":"Can we convert client side control as a server side control? Can we convert server side control as client side control? ",
      "answer":"Yes.\nWe can convert Client side control as server side control by adding an ATTRIBUTE called runat=‖server‖.\nBut we cannot convert server side control as client side control."
    },
    {"id":"6",
      "q":"How can you pass values between ASP.NET pages? ",
      "answer":"Different techniques to move data from one web form to another are:\n1. Query string\n2. Cookies\n3. Session state\n4. Application state\n5. Cross page postback\n6. Context.Handler object   "
    },

    {"id":"7",
      "q":" What is the difference between Response.Redirect() and  Server.Transfer()?",
      "answer":" Response. Redirect(): \n 1. It is used to navigate the user request between multiple web servers.\n2. It will not hide the Destination url address.  \nServer. Transfer():  \n1. It is used to navigate the user request within the web server.  \n2. It will hide the Destination url address.   "
    },

    {"id":"8",
      "q":" Explain about validation controls in asp.net?",
      "answer":"There are 6 Validator Controls. They are  \n1. Requiredfield Control  \n2. Compare validator  \n3. Range validator  \n4. Regular Expression validator  \n5. Custom validator  \n6. Validation summary"
    },
    {"id":"9",
      "q":"When we will go for custom validator control? ",

      "answer":"Whenever our validation requirement is unable to achieve with the help of existing validation controls then we have to go for CUSTOM VALIDATOR CONTROL."
    },

    {"id":"10",
      "q":"How to invoke server side validation function and how to invoke client side validation function?",
      "answer":"Server side validation functions can be invoked by using ASP.NET and Client side validation function are invoked with the help of JavaScript and HTML."
    },

    {"id":"11",
      "q":" How to access information about a user’s locale in ASP.NET? ",

      "answer":"User’s locale information can be accessed through System.Web.UI.Page.Culture property."
    },

    {"id":"12",
      "q":" What are the life cycle events of asp.net?",
      "answer":"\nApplication level, \nControl level, \nPage level."
    },
    {"id":"13",
      "q":"What are the Asp.Net page cycle stages?",
      "answer":" There are overall 8 stages available for any webpage that will undergo with in server at page life cycle.  \n1) Page Request  \n2) Start \n3) Page Initialization  \n4) Load  5) Validation  \n6) PostBack Event Handling  \n7) Rendering \n8) Unload"
    },

    {"id":"14",
      "q":"What are page life cycle events?",
      "answer":" 1. Page_PreInit  \n2. Page_Init \n3. Page_InitComplete,  \n4. Page_PreLoad  \n5. Page_Load  \n6. Page_LoadComplete  \n7. Page_PreRender  \n8. Page_PreRenderComplete,  \n9. Page_Unload "
    },

    {"id":"15",
      "q":" In asp.net page life cycle events which will fire first? ",
      "answer":" Page_PreInit   "
    },

    {"id":"16",
      "q":" What is the difference between event and method? ",
      "answer":"Event will execute for some action i.e called as event firing or event calling or event executing.  Whereas method will contain some behavior or functionality.   "
    },

    {"id":"17",
      "q":"What are the default events of controls Button and Textbox?",
      "answer":"Default events of: Button: CLICK Event  TextBox: TEXTCHANGED Event   "
    },
    {"id":"18",
      "q":" What do u mean by postback? ",
      "answer":")When ever user request for a page for first time it is called First request. When ever user will interact the page by clicking button or selecting radiobutton e.t.c again one more request for the same page that is called postback request. "
    },

    {"id":"19",
      "q":"What is Ispostback? When we will use Not Ispostback? ",
      "answer":" IsPostBack: \nIt is the property of the Page class which is used to determine whether the page is posted back from the client.  When: Whenever we don’t want to execute the code within the load event, when the page load event fires then we will use (!IsPostBack).   "
    },

    {"id":"20",
      "q":" What is AutopostBack? when we will set Autopostback=true?",
      "answer":"Autopostback is the property of the control. If you want a control to postback automatically when an event is raised, you need to set the AutoPostBackproperty of the control to True. "
    },
    {"id":"21",
      "q":"Difference between web user control & custom control?",
      "answer":"WEB USER CONTROL\n1. It will provide services to single  web applications.\n2.Its file is represented with *.ascx\n3. If we want to develop a web user   we have to use a class library template called web user control to the project.\n4. Web user control we have to drag from solution explorer window to web toolbox window to web page.\nCUSTOM CONTROL\n1. It will provide services to multiple applications.   2.Its file is represented with *.dll file\n3. If we want to develop a custom control we have to add a pre-defined controlsolution explorer of the application\n4.Custom control we have to drag from  page.     "

    },
    {"id":"22",
      "q":"How to get the current date to textbox? ",
      "answer":" TextBox1.Text = DateTime.Now.ToString();"
    },

    {"id":"23",
      "q":"How to divide the page into different parts?",
      "answer":" By using div tag and panel control."
    },{"id":"24",
      "q":" What is Rendering?   ",
      "answer":"Rendering is a process of converting complete server side code into client understable code. It will happen before page is submitting to the client."
    },{"id":"25",
      "q":" What is the difference between ASP and ASP.Net?  ",
      "answer":" ASP:-\n1. Asp is a classic server side\n2. Asp will support only ONE\n3.In Asp, its file extension is .asp\n4. Asp uses mostly VBScript, HTML\n5. Asp has limited OOPs support.\nASP.NET\n1. Asp.Net is a .Net advanced server technology before .NET side technology.\n2. Asp.Net will support 2 programming programming technique called INPAGE techniques\ni.e INPAGE and TECHNIQUE(writing both CODEBEHIND technique (design/logic) code in the single filecalled NOTEPAD)\n3.In Asp, its file extension is .aspx\n4. Asp.Net uses any .Net languages and JavaScript including VB.Net, C# but mostly  C#.Net.\n5. ASP.NET uses languages which are  fully object oriented languages like C#"
    },{"id":"26",
      "q":"What is the parent class for all asp.net web server controls?",
      "answer":"System.Web.UI.Control."
    },{"id":"27",
      "q":" How many types of memories are there in .net?",
      "answer":"Two types of memories are there in.net.  \n1. Stack memory and  \n2.Heap memory"
    },{"id":"28",
      "q":"D/B client side and server side scripting?  ",
      "answer":"  Client Side Scripting\n1. Scripting which will execute withinthe web browser can be called as clientside scripting.\n2. Using this we can implement client\n3. Client side scripting we can  client side implement by using called Asp.Net, JSP, PHP script and so on.\nServer Side Scripting   1. Scripting which will execute within  the web server can be called as client side scripting.\n2. Using this we can implement server side validations. side validations.   3. Server side scripting we can implement by using\nserver side technologies called JavaScript, VB technologies  and so on.."
    },{"id":"29",
      "q":"When we will go for gridview customization? ",
      "answer":"Whenever we want to display the Gridview control according to our requirement then we will go for Gridview Customisation."
    },{"id":"30",
      "q":" What is AutoGenerateColumns property? ",
      "answer":"It is a Boolean property of gridview control. By default it is true.  If we want to customize gridview control..we have to set it as false."
    },{"id":"31",
      "q":"List out directories in Asp.Net?  ",
      "answer":"It is a particular property, which describes the entity."
    },{"id":"32",
      "q":" What are the major built in objects in asp.net?",
      "answer":" Application, Request, Response, Server, Session.   "
    },{"id":"33",
      "q":" When we will go for master page?",
      "answer":"Whenever we want to have common header and common footer within multiple pages of a website then we can go for a Master Page.   "
    },{"id":"34",
      "q":" When can we use xml control? ",
      "answer":"Whenever we want to display the data from XML document to the user then we can use XML control.  NOTE: To fetch the data from XML document, XML control will depend on  XSLT(Extensible Style sheet Language Transformation) file.  XSLT file will be acting as a mediator between XML control and XML document.   "
    },{"id":"35",
      "q":"When can we use wizard control?",
      "answer":"Whenever we want to accept multiple inputs from the user in STEP by STEP process we can use WIZARD CONTROL."
    },{"id":"36",
      "q":" When can we use adRotator control?",
      "answer":"Whenever we want to display the collection of images in a rotation manner one by one then we will go for Adrotator control.  "
    },{"id":"37",
      "q":" How view and Multiview controls will work?",
      "answer":"View and multiview are container controls.  Multiview control: It can contain collection of view controls but not a normal control.\nView Control: It can contain normal controls, but view control should be placed within the multiview.  By implementing view and multiview control we can reduce the no. of pages. "
    },{"id":"38",
      "q":" What are the config files we have in asp.net?",
      "answer":"In ASP.NET we have 2 types of Configuration files. They are- \n1. Web.Config and \n2. Machine.config"
    },{"id":"39",
      "q":" What is web.config file? How many web.cofig can contain a single application?  ",
      "answer":"1. Web.Config is one of the configuration files.  \n2. It is a XML file. \n3. This file we can use to define the ASP.NET application configuration settings.  We can have MULTIPLE Web.Config files within a single application."
    },{"id":"40",
      "q":" Can we declare more than oneconnection string in web.config file? ",
      "answer":"YES. But the connection string names must be different."
    },{"id":"41",
      "q":" When we will go for multiple web.config files? ",
      "answer":"Whenever we want to define some separate settings for couple of web pages, we will create a new folder and we will add that couple of web pages to that folder and we will add a new Web.config file to that new folder and we will define that separate settings within that Web.config."
    },{"id":"42",
      "q":"  What is the importance of machine.config? How many machine.config files? ",
      "answer":"The Machine.Config file, which specifies the settings that are global to a particular machine.  Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered. We can have only ONE machine.config files."
    },{"id":"43",
      "q":" What is the Difference between Hyperlink button and Link Button?",
      "answer":"  Hyperlink: It will not PostBack the webpage to the server. Link Button: It will postback the webpage to the server."
    },{"id":"44",
      "q":"What is State Management? Why?",
      "answer":" STATE MANAGEMENT: It is a process of maintaining the user’s information.  WHY: Asp.Net web application is depending on HTTP protocol which is a STATELESS protocol that means it cannot remember previous user information. Solution for this problem is STATE MANAGEMENT."
    },{"id":"45",
      "q":" How many types of state management? ",
      "answer":"We can implement STATE MANAGEMENT in 2 ways.  \n1. Server Side State Management and  \n2. Client Side State Management."
    },{"id":"46",
      "q":" What is client side state management? How many types?",
      "answer":"Storing the user’s information within the WEB BROWSER memory or CLIENT MACHINE is called as Client Side State Management.   "
    },{"id":"47",
      "q":" What is server side state management? How many types?",
      "answer":" Storing the user’s information within the WEB SERVER memory is called as  Server Side State Management.    "
    },{"id":"48",
      "q":"  What is a session? How many types of sessions?  What is a session? How many types of sessions? ",
      "answer":"Session is a temporary variable which will be used to maintain the user information.  Based on the locations, sessions are of4 types:  1. Inproc session  2. State server session  3. Sql server session  4. Custom session  "
    },{"id":"49",
      "q":" What is the default type of session data? ",
      "answer":"OBJECT.    "
    },{"id":"50",
      "q":" What is the default life time of session variable?  ",
      "answer":"20 Minutes"
    },{"id":"51",
      "q":" Where we will define the session state type? ",
      "answer":"Within the Web.config , under the <System .Web> TAG.   "
    },
    {"id":"52",
      "q":"What is the Default Session state mode?",
      "answer":" The default Session state mode is INPROC.   "
    },{"id":"53",
      "q":" How to set the life time of session variable? ",
      "answer":"Using TimeOut property.  "
    },{"id":"54",
      "q":"How to destroy session?",
      "answer":"Using Abondon(). i.e Session.Abondon() will destroy the session"
    },{"id":"55",
      "q":"What are the advantages of inproc session and disadvantages?  ",
      "answer":"ADVANTAGES OF INPROC SESSION:  \n1. Accessing the inproc session data will be faster.  \n2. It is very much suitable for small web applications  \nDISADVANTAGES OF INPROC SESSION:  \n1. It we restart the web server or if any crashes to the web server there is a chance of losing the session data.  \n2. If the session data is increased there is a burden on the web server, it will affect the performance of web server and web application.  \n3. It is not suitable for large web application models like webgarden and webfarm."
    },{"id":"56",
      "q":"What are the advantages of state server session and disadvantages?",
      "answer": "ADVANTAGES OF STATE SERVER SESSION:  \n1. State server session will provide more security because sessions are creating separately within the windows service.  2. If we restart the web server or if any crashes to the web server but still session data will be safe.  3. It is suitable for large web applications like webgarden and webfarm model.  DISADVANTAGES OF STATE SERVER SESSION:  1. Accessing the state server session will be slower compare with inproc session.  2. It is not that much suitable for small web applications because maintaining the windows service is expensive.  3. Always windows service should be ON."
    },{"id":"57",
      "q":"Where inproc session data will store?  ",
      "answer":" Inproc sessions are creating within the Current App Domain, which is a part of Web Server."
    },{"id":"58",
      "q":"Where state server session will store? ",
      "answer":"State server session are creating within the state server which is nothing but Windows Service, this windows service is representing by a file called (AspNet_state.exe).     "
    },{"id":"59",
      "q":" How to start windows service? ",
      "answer":"can start the Windows Service in 2 ways-  \n1. By using control panel and  \n2. By using Command prompt."
    },{"id":"60",
      "q":" Where sql server session will store?  ",
      "answer":"Sql server sessions will be creating within the Sql Server Database. "
    },{"id":"61",
      "q":" What is the framework tool will user to create aspstate database with in sqlserver? ",
      "answer":"aspnet_regsql"
    },




    {"id":"62",
      "q":" What are the session related events? ",
      "answer":"There are 2 Types of Session events.  \n1. Session Start and  \n2. Session End."
    },
    {"id":"63",
      "q":" When we will go for session concept? ",
      "answer":"Whenever we want to store user data within the server."
    },

    {"id":"64",
      "q":" What is worker process?",
      "answer":"Worker process is nothing but Asp.Net execution engine or Asp.Net runtime. The role of Asp.Net runtime is executing the Asp.Net web page within the Web server."
    },

    {"id":"65",
      "q":" What is appdomain?",
      "answer":"Every worker process will maintain a memory unit within the web server which is nothing but Appdomain."
    },
    {"id":"66",
      "q":"What is application pool?",

      "answer":"It is part of web server or a unit of web server."
    },

    {"id":"67",
      "q":"What is webgarden?",
      "answer":"An application pool which is having multiple WORKER PROCESS is called as WEB GARDEN."
    },

    {"id":"68",
      "q":" What is webfarm?",

      "answer":" Deploying a website into multiple web servers is called Webfarm."
    },

    {"id":"69",
      "q":" Why inproc session is not suitable for webgarden and webfarm model?",
      "answer":" Inproc sessions will create within the current App Domain due to that reason app domain data is not sharable due to that reason Inproc sessions are not suitable for WEB GARDEN and WEBFARM MODELS."
    },
    {"id":"70",
      "q":" When we will go for application state?",
      "answer":"when ever we want to store the data in web server..which should be common for all users.  \nFor example:  In youtube video number of views"
    },

    {"id":"71",
      "q":" What are application events?",
      "answer":"There are 3 application events.  \n1. Application Start Event  \n2. Application End Event  \n3. Application Error Event."
    },

    {"id":"72",
      "q":"Difference between session state and application state?",
      "answer":"1. Application state: \n1.It will be available to all users of the application.  \n2. Application state variables are cleared, when the process hosting the application is restarted. \n2.Session state: \n1. It will only be available to a specific user of the ASP.net application.  \n2. Session state variable are cleared, when the user session times out. The default is  20 minutes. This is configurable in Web.Config."
    },

    {"id":"73",
      "q":" What is global.asax file?",
      "answer":" This is a class file, which is coming with 1 user defined called Global and it has a super class called HTTPApplication. This file will contain all the application session related events."
    },

    {"id":"74",
      "q":" What is a cookie?",
      "answer":" Cookie is a variable which we can use to store the user data.  It will create within the client machine due to that reason which is called as client side state management."
    },
    {"id":"75",
      "q":"  What is the default life of cookie?",
      "answer":" 30 Minutes."
    },

    {"id":"76",
      "q":"Types of cookies?  ",
      "answer":"  Cookies can be broadly classified into 2 types  \n1. Persistent cookies: Remain on the client computer, even after the browser is closed. You can configure how long the cookies remain using the expires property of the Http Cookie object.  \n2. Non-Persistent cookies: If you don't set the Expires property, then the cookie is called as a Non-Persistent cookie. Non-Persistent cookies only remain in memory until the browser is closed."
    },

    {"id":"77",
      "q":"What is the Scope of Cookie?",
      "answer":"Throughout the website."
    },
    {"id":"78",
      "q":" What is the Difference between Cookie and Session?",
      "answer":"COOKIE\n1. Cookie is a client side state management technique.\n2. Cookie is a variable which will create  the client machine.\n3. Default timeout of a cookie is 30 minutes\nSESSION\n1. Session is a server side state management technique.\n2. Session is also a variable which will within within the Web server\n3. Default life time of session variable is . 20 minutes.."
    },
    {"id":"79",
      "q":"What is querystring?",
      "answer":" 1.QueryString is a way to forward the data from one web page to another. 2. QueryString is attached to the URL with .\nDrawbacks: \n1. All the attributes and values are visible to the end user. Therefore, they are not secure. \n2. There is a limit to URL length of 255 characters."
    },
    {"id":"80",
      "q":" What is Viewstate? What is the scope of view state",
      "answer":"1. Viewstate will maintain the user’s data among multiple postbacks requests.  \n2. View state will store the user’s data within client machine due to that reason it is called as CLIENT SIDE STATE MANGEMENT.  \n3. The scope of the Viewstate is within that web form."
    },{"id":"81",
      "q":"Is HTML controls will maintain Viewstate? ",
      "answer":"NO. Because HTML controls are Client side controls."
    },{"id":"82",
      "q":"  What is Hiddenfield and what is the scope?",
      "answer":"\n1. HiddenField is a Server side control, which can hold the user data but holding the data will not be visible because it is a INVISIBLE CONTROL. \n2. To Implement HiddenField we can use Asp.Net server control called HiddenField."
    },{"id":"83",
      "q":"  What is caching?",
      "answer":"Caching is a process of storing the frequently used web page (or) frequently used part of the web page (or) frequently used data into some location for future access."
    },{"id":"84",
      "q":" How many locations we can implement caching?",
      "answer":" According to the location caching is classified into 4 types. \n1. Client caching  \n2. Proxy caching  \n3. Reverse caching  \n4. Web server caching"
    },{"id":"85",
      "q":"What are types of caching techniques?",
      "answer":"Asp.Net will support 3 Caching Techniques.  \n1. Page Output Caching  \n2. Fragment Output caching  \n3. Data Caching"
    },{"id":"86",
      "q":"When we will go for page output caching?",
      "answer":"Whenever we want to store the frequently used web page into some location then we will go for PAGE OUTPUT CACHING. \n  In general, we will implement page caching on startup page such as login and home page."
    },
    {"id":"87",
      "q":" When we will go for fragment caching?",
      "answer":"Whenever we want to store the frequently used part of the web page into some location for future access then we will go for FRAGMENT CACHING.  \n Fragment caching we will implement on a Web user control, which is accessing by multiple web pages."
    },
    {"id":"88",
      "q":"When we will go for data caching?",
      "answer":" Whenever we want to store the frequently used data for future access into some location then we will go for DATA CACHING."
    },
    {"id":"89",
      "q":" What is class we will use to access global connection string? ",
      "answer":"ConfigurationManager class."
    },
    {"id":"90",
      "q":" What is security?",
      "answer":"Security is a process of allowing the authenticated users and denying the unauthorized users when user is requested for restricted web page.   "
    },
    {"id":"91",
      "q":"  What is authorization?",
      "answer":" Authorization is a process of verifying the authentication ticket and supplying the web page based on authentication ticket."
    },

    {"id":"92",
      "q":" What is Authentication?  ",
      "answer":"  Authentication is a process of accepting the user credentials, when user will request for a restricted web page and generating the authentication ticket for the valid user."
    },

    {"id":"93",
      "q":" How many types of authentications will support by asp.net?",
      "answer":" It will support 3 types of authentications.  \n1. Forms authentication  \n2. Passport authentication  \n3. Windows authentication"
    },
    {"id":"94",
      "q":"  What is returnurl?",
      "answer":"it is querystring varible   "
    },
    {"id":"95",
      "q":" What is the class we will use for forms authentication?",
      "answer":" FormsAuthentication"
    }, {"id":"96",
      "q":" When we will go for forms authentication?",
      "answer":"Forms authentication is used for normal web applications."
    },{"id":"97",
      "q":"When we will go for passport authentication?  ",
      "answer":"A group of websites which will allow the user with single user id and password will go for the passport authentication.  Ex: If we have Gmail id with that we can access Gmail, Facebook, Youtube etc"
    },{"id":"98",
      "q":"  When we will go for windows authentication?",
      "answer":"Whenever users are part of the same Windows domain as the server then the Windows Authentication is the preferred approach to authentication.  In other words, whenever we have intranet web applications it is better to go with Windows Authentication."
    },{"id":"99",
      "q":" List out Gridview events??",
      "answer":"\n1. Row deleting and Row deleted  \n2. Row editing \n3. Row updating and Row updated  \n4. Row Cancelling edit  \n5. Row command  \n6. Row created  \n7. Row DataBound  \n8. Page index changing and page index changed  \n9. Sorted and sorting."
    },
    {"id":"100",
      "q":" What is the use of sqldata source control?",
      "answer":"  SqlData Source will make the programmer task easy to communicate SqlServer Database.    "
    },

    {
      "id":"101",
      "q":" When we will go for repeater control?",
      "answer":" Whenever we want to display the data as it is we can go for Repeater control, that means we don’t require to provide any Edit or Delete facilities.  Ex: To display Bank Statements and Examination results.   "
    },{"id":"102",
      "q":"When we will go for datalist control?",
      "answer":"Whenever we want to display the data in a repeating list format then we will go for Datalist control."
    },
    {"id":"103",
      "q":" When we will go for formview and when we will go for details view?",
      "answer":"FORMVIEW: Whenever we want to display record by record in VERTICAL manner then we can go for Formview.  Details View: Whenever we want to display record by record in HORIZONTAL manner then we can go for Details view."
    },
    {"id":"104",
      "q":" What is the use of data pager control?",
      "answer":"Data pager control provides paging functionality for data bound controls."
    },
    {"id":"105",
      "q":" Difference between listbox and dropdownlist?",
      "answer":" LISTBOX: It will allow the user to select one item or multiple items. DropDownList: It will allow the user to select only one item.   "
    },
    {
      "id":"106",
      "q":" where is the viewstate information stored?",
      "answer":"  Within the html hidden fields."},
    {

      "id":"107",
      "q":"which are the 2 properties are on every validation control? ",
      "answer":"\n 1.ControlToValidate and \n2.ErrorMessage."
    },
    {"id":"108",
      "q":"  what is the use of @register directives?",
      "answer":"It informs the compiler of any custom server control added to the page."
    },
    {"id":"109",
      "q":" what is the textbox property used for password textbox?",
      "answer":"TextMode"
    },
    {"id":"110",
      "q":" How to reduce the burden on the page?",
      "answer":" By implementing paging. Search Results"
    }
  ]

}