Interview q&a
Does the thought of going for an interview, make you break into a cold sweat? Most people do badly at job interviews not because they are incompetent but simply because they are just plain nervous.
Job interviews usually have two parts -- technical and HR. While the technical interview deals with your knowledge in the field, HR tests your personality and presence of mind. Here are a few tips on how to make a good impression at your job interview:
• Confidence is the most important aspect. You should appear confident, keep your wits about you and listen to every word of the question. Often, prospective employees usually don't even hear the question properly in their nervousness. Fumbling and stammering (if not a medical problem) will not work in your favour.
• While confidence is good, never appear over-confident. This presents you as a pompous and bossy person, definitely not the qualities of a team player.
• Never panic. If you don't know the answer to a question, try this old trick -- ask the interviewer to repeat the question. It lets you hear the question again, gives you time to think and eliminates any embarrassing pauses.
• Thinking on your feet is very important. In a situation where three or four pairs of eyes are staring at you, it is easy to get intimidated. Practice thinking on your feet by having mock interviews with friends. Quick-wittedness is not something you can learn but mock interviews help you think faster than you otherwise would.
Dinesh Samtani, Divya Pinge and Srilaxmi Pai have only recently started working and are fresh on the job market. Here are some tips they had on how tackle difficult interview questions:
Q: Tell us about yourself.
A: This is possibly the most common question asked; it is the answer to this question that gives your prospective employer the supremely important first impression. Most people tend to talk about their family -- what their parents do for a living and what their siblings are doing at the moment. This is NOT what the interviewer is interested in. Talk mostly about yourself -- your education, previous jobs, achievements, interests and strong points of your personality. Once you're done, give a very brief description of your family.
Q: What are your weaknesses? Or what would you like to change about yourself?
A: Although being honest is always better, make sure that your answer does not project you in a bad light. Saying things like "bad at decision making" or "not punctual" go against you. Always say things that can be converted into a positive. For instance: "I am forgetful but I am now trying to get over my weakness by keeping reminders on my phone and writing what I might forget"; You could even say: "I used to be disorganised but now I carry an electronic organiser to keep my phone numbers, deadlines etc". Never say things like "I don't see any weakness in myself", you might just end up annoying the interviewer.
Q: What are your strengths?
A: Some people might get carried away here and end up boasting. The interviewer is looking for skills that will benefit the company, so base your answer on what the company might want. Being a good team player, leadership qualities, analytical skills are among common virtues employers are looking for. Never lie about your virtues, it will catch up with you sooner or later. As always, honesty is the best policy.
Q: What is the one thing you would like to change about your college/ previous office?
A: Always say things that are not too negative. Complaining about your prior bosses or professors shows you in a bad light. Talk of things that are small but not inconsequential. Srilaxmi, for instance, said that she wanted the library timings to be extended.
Q: What would your prior boss/ professor have to say about you?
A: It is good to be prepared for this question. Ask your professor or boss to write a recommendation letter for you if possible. This is useful to present to the interviewer. State what the person would say and then present the letter as proof. This gives the impression of a well-prepared and confident person.
Q: What do you know about our company?
A: Make sure you do your homework before you appear for an interview. Read up on the company's history, progress report and statistics. A small margin is permissible while stating figures but it is best avoided.
Q: Why should I hire you?
A: It's a safe bet to say that you are the best person for the job. But don't sound boastful or pompous. Base your claims with solid results, tell the interviewer why you stand out among all the others and give examples of your expertise.
Q: Name one thing you want to change about yourself.
A: Here, the interviewer will tempt you to sound negative. Never say that you are perfect but at the same time, touch upon you weaknesses in such a way that they seem insignificant. Name an incident in the past that you faltered in, then show that you have now improved.
Q: Where do you see yourself five years from now?
A: It's good to talk of your progress with respect to the company. The interviewer needs to understand that you are not just job-hopping. Things like you see yourself at a much higher post that the one you are applying for, will work in your favour. Tell them that you hope that this job will make you a better professional than you already are and you will also help the company to improve in the department you are going to be working. Then go on to show by your examples what you are doing to reach your goals and objectives.
Q: Do you think your qualifications make you eligible for this job? What has the course taught you?
A: The interviewer probably knows all about your course pattern and has probably studied it himself/ herself. There is no point in discussing it academically; use a more behavioural approach. Your education has made your basics are clear, you have a strong foundation on which to build a career, it has not only taught you the technical aspects of the job you are about to take up but also made you a better professional are all good responses.
Q: Would you call yourself a team player?
A: The obvious answer to this answer is yes. But the way you support this answer is what makes all the difference. Always keep a few instances of when you showed team spirit in mind. It helps to display your ability. Another way in which this question can be asked is by giving you an actual case. The interviewer puts you in a situation and asks what you will do. It is important to think quick and come up with answers showing that you can bring out the best in others and yourself, believe in organisation, communication and delegation of tasks etc.
• Great interview but no job?
The following questions test not your character but your presence of mind. It is important to be alert when faced with these questions, don't take too long to answer:
Q: What part of your body would you hide if you were on the street completely naked?
A: My face, obviously, so no one would know it's me.
Q: What is the colour of the wall behind you?
A: The same as the colour of the wall in front of me. Never turn back and answer this! There is a possibility that the colour might be different but most rooms are painted the same colour. Looking at the interiors of the room you can gauge whether it has a feature (differently coloured) wall or not.
Q: Suppose you have a brother. You go home and open the door and there he is totally naked in front of you. What would u do?
A: I'd pick him up and go put his nappies on him. No one told you your brother's age!
Q: Why are manhole covers round and not square?
A: Because the square cover can fall down if kept vertically along the diagonal.
Q: What is the fastest thing on earth? Why?
A: The mind is the fastest thing. It can be at two places at once and can travel continents in a matter of seconds.
Q: If you were a crayon, what colour would you be?
A: The last thing you want to do here is say any random colour that comes to your head and then give a justification. Think about your best quality, and then associate it with an appropriate colour. For example: "I think I would be blue because I'm very calm and composed at all times. I can keep my head cool in the most stressful situation and take difficult decisions."
These questions are tough but are not really a deciding factor in the interview. Your overall personality and disposition can always convince the interviewer to consider you for the post despite whatever happens in the interview. Calm your nerves and think clearly. Honesty and clarity can impress the employer but a know-it-all attitude is career suicide. Keep these simple tips in mind and you should sail through those nerve-racking interviews!
Saturday, December 29, 2007
.net interview q's
ASP.Net interview questions
1. What do I need to create and run an ASP.NET application?
* Windows 2000, Windows Server 2003 or Windows XP.
* ASP.NET, which can be either the redistributable (included in the .NET SDK) or Visual Studio .NET.
1. Where can I download the .NET SDK?
.NET SDK can be obtained here.
(You have to install the Microsoft .NET Framework Version 1.1 Redistributable Package before installing the .NET SDK.)
2. Are there any free IDEs for the .NET SDK?
* Microsoft provides Visual Studio 2005 Express Edition Beta for free. Of particular interest to the ASP.NET developers would be the Visual Web Developer 2005 Express Edition Beta 2 available as a free download.
* The ASP.NET Web Matrix Project (supported by Microsoft) is a free IDE for developing ASP.NET applications and is available here.
* There is also a free open-source UNIX version of the Microsoft .NET development platform called Mono available for download here.
* Another increasingly popular Open Source Development Environment for .NET is the #develop (short for SharpDevelop) available for download here.
3. When was ASP.NET released?
ASP.NET is a part of the .NET framework which was released as a software platform in 2002.
4. Is a new version coming up?
ASP.NET 2.0, Visual Studio 2005 (Whidbey), Visual Web Developer 2005 Express Edition are the next releases of Microsoft's Web platform and tools. They have already been released as Beta versions. They are scheduled to be released in the week of November 7, 2005.
5. Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.
6. List the types of Authentication supported by ASP.NET.
* Windows (default)
* Forms
* Passport
* None (Security disabled)
7. What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).
8. What is CLI?
The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)
9. List the various stages of Page-Load lifecycle.
* Init()
* Load()
* PreRender()
* Unload()
10. Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.
11. What is Shadow Copy?
In order to replace a COM component on a live web server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.
12. What is DLL Hell?
DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.
13. Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.
14. Explain Windows Forms.
Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.
15. What is Postback?
When an action occurs (like button click), the page containing all the controls within the tag performs an HTTP POST, while having itself as the target URL. This is called Postback.
16. Explain the differences between server-side and client-side code?
Server side scripting means that all the script will be executed by the server and interpreted as needed. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source. It also poses as a possible security hazard for the client computer.
17. Enumerate the types of Directives.
* @ Page directive
* @ Import directive
* @ Implements directive
* @ Register directive
* @ Assembly directive
* @ OutputCache directive
* @ Reference directive
18. What is Code-Behind?
Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page.
19. Describe the difference between inline and code behind.
Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code. Code-behind is code written in a separate file and referenced by the .aspx page.
20. List the ASP.NET validation controls?
* RequiredFieldValidator
* RangeValidator
* CompareValidator
* RegularExpressionValidator
* CustomValidator
* ValidationSummary
21. What is Data Binding?
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
22. Describe Paging in ASP.NET.
The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.
23. Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server and minimally on the client-side, though it is a good way to reduce server load and network traffic because we can ensure that only data of the appropriate type is submitted from the form. It is totally insecure. The user can view the code used for validation and create a workaround for it. Secondly, the URL of the page that handles the data is freely visible in the original form page. This will allow unscrupulous users to send data from their own forms to your application. Client-side validation can sometimes be performed where deemed appropriate and feasible to provide a richer, more responsive experience for the user.
24. What is the difference between Server.Transfer and Response.Redirect?
* Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
* Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.
26. What is an interface and what is an abstract class?
In an interface, all methods must be abstract (must not be defined). In an abstract class, some methods can be defined. In an interface, no accessibility modifiers are allowed, whereas it is allowed in abstract classes.
27. Session state vs. View state:
In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations:
* Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used.
* Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option.
* Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.
28. Can two different programming languages be mixed in a single ASPX file?
ASP.NET’s built-in parsers are used to remove code from ASPX files and create temporary files. Each parser understands only one language. Therefore mixing of languages in a single ASPX file is not possible.
29. Is it possible to see the code that ASP.NET generates from an ASPX file?
By enabling debugging using a <%@ Page Debug="true" %> directive in the ASPX file or a statement in Web.config, the generated code can be viewed. The code is stored in a CS or VB file (usually in the \%SystemRoot%\Microsoft.NET\Framework\v1.0.nnnn\Temporary ASP.NET Files).
30. Can a custom .NET data type be used in a Web form?
This can be achieved by placing the DLL containing the custom data type in the application root's bin directory and ASP.NET will automatically load the DLL when the type is referenced.
31. List the event handlers that can be included in Global.asax?
* Application start and end event handlers
* Session start and end event handlers
* Per-request event handlers
* Non-deterministic event handlers
32. Can the view state be protected from tampering?
This can be achieved by including an @ Page directive with an EnableViewStateMac="true" attribute in each ASPX file that has to be protected. Another way is to include the statement in the Web.config file.
33. Can the view state be encrypted?
The view state can be encrypted by setting EnableViewStateMac to true and either modifying the element in Machine.config to or by adding the above statement to Web.config.
34. When during the page processing cycle is ViewState available?
The view state is available after the Init() and before the Render() methods are called during Page load.
35. Do Web controls support Cascading Style Sheets?
All Web controls inherit a property named CssClass from the base class System.Web.UI.WebControls.WebControl which can be used to control the properties of the web control.
36. What namespaces are imported by default in ASPX files?
The following namespaces are imported by default. Other namespaces must be imported manually using @ Import directives.
* System
* System.Collections
* System.Collections.Specialized
* System.Configuration
* System.Text
* System.Text.RegularExpressions
* System.Web
* System.Web.Caching
* System.Web.Security
* System.Web.SessionState
* System.Web.UI
* System.Web.UI.HtmlControls
* System.Web.UI.WebControls
37. What classes are needed to send e-mail from an ASP.NET application?
The classes MailMessage and SmtpMail have to be used to send email from an ASP.NET application. MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's System.Web.Mail namespace.
38. Why do some web service classes derive from System.Web.WebServices while others do not?
Those Web Service classes which employ objects like Application, Session, Context, Server, and User have to derive from System.Web.WebServices. If it does not use these objects, it is not necessary to be derived from it.
39. What are VSDISCO files?
VSDISCO files are DISCO files that enable dynamic discovery of Web Services. ASP.NET links the VSDISCO to a HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.
40. How can files be uploaded to Web pages in ASP.NET?
This can be done by using the HtmlInputFile class to declare an instance of an tag. Then, a byte[] can be declared to read in the data from the input file. This can then be sent to the server.
41. How do I create an ASPX page that periodically refreshes itself?
The following META tag can be used as a trigger to automatically refresh the page every n seconds:
42. How do I initialize a TextBox whose TextMode is "password", with a password?
The TextBox’s Text property cannot be used to assign a value to a password field. Instead, its Value field can be used for that purpose.
ID="Password" RunAt="server" />
43. Why does the control's PostedFile property always show null when using HtmlInputFile control to upload files to a Web server?
This occurs when an enctype="multipart/form-data" attribute is missing in the
1. What do I need to create and run an ASP.NET application?
* Windows 2000, Windows Server 2003 or Windows XP.
* ASP.NET, which can be either the redistributable (included in the .NET SDK) or Visual Studio .NET.
1. Where can I download the .NET SDK?
.NET SDK can be obtained here.
(You have to install the Microsoft .NET Framework Version 1.1 Redistributable Package before installing the .NET SDK.)
2. Are there any free IDEs for the .NET SDK?
* Microsoft provides Visual Studio 2005 Express Edition Beta for free. Of particular interest to the ASP.NET developers would be the Visual Web Developer 2005 Express Edition Beta 2 available as a free download.
* The ASP.NET Web Matrix Project (supported by Microsoft) is a free IDE for developing ASP.NET applications and is available here.
* There is also a free open-source UNIX version of the Microsoft .NET development platform called Mono available for download here.
* Another increasingly popular Open Source Development Environment for .NET is the #develop (short for SharpDevelop) available for download here.
3. When was ASP.NET released?
ASP.NET is a part of the .NET framework which was released as a software platform in 2002.
4. Is a new version coming up?
ASP.NET 2.0, Visual Studio 2005 (Whidbey), Visual Web Developer 2005 Express Edition are the next releases of Microsoft's Web platform and tools. They have already been released as Beta versions. They are scheduled to be released in the week of November 7, 2005.
5. Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.
6. List the types of Authentication supported by ASP.NET.
* Windows (default)
* Forms
* Passport
* None (Security disabled)
7. What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).
8. What is CLI?
The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)
9. List the various stages of Page-Load lifecycle.
* Init()
* Load()
* PreRender()
* Unload()
10. Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.
11. What is Shadow Copy?
In order to replace a COM component on a live web server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.
12. What is DLL Hell?
DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.
13. Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.
14. Explain Windows Forms.
Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.
15. What is Postback?
When an action occurs (like button click), the page containing all the controls within the
16. Explain the differences between server-side and client-side code?
Server side scripting means that all the script will be executed by the server and interpreted as needed. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source. It also poses as a possible security hazard for the client computer.
17. Enumerate the types of Directives.
* @ Page directive
* @ Import directive
* @ Implements directive
* @ Register directive
* @ Assembly directive
* @ OutputCache directive
* @ Reference directive
18. What is Code-Behind?
Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page.
19. Describe the difference between inline and code behind.
Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code. Code-behind is code written in a separate file and referenced by the .aspx page.
20. List the ASP.NET validation controls?
* RequiredFieldValidator
* RangeValidator
* CompareValidator
* RegularExpressionValidator
* CustomValidator
* ValidationSummary
21. What is Data Binding?
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
22. Describe Paging in ASP.NET.
The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.
23. Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server and minimally on the client-side, though it is a good way to reduce server load and network traffic because we can ensure that only data of the appropriate type is submitted from the form. It is totally insecure. The user can view the code used for validation and create a workaround for it. Secondly, the URL of the page that handles the data is freely visible in the original form page. This will allow unscrupulous users to send data from their own forms to your application. Client-side validation can sometimes be performed where deemed appropriate and feasible to provide a richer, more responsive experience for the user.
24. What is the difference between Server.Transfer and Response.Redirect?
* Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
* Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.
26. What is an interface and what is an abstract class?
In an interface, all methods must be abstract (must not be defined). In an abstract class, some methods can be defined. In an interface, no accessibility modifiers are allowed, whereas it is allowed in abstract classes.
27. Session state vs. View state:
In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations:
* Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used.
* Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option.
* Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.
28. Can two different programming languages be mixed in a single ASPX file?
ASP.NET’s built-in parsers are used to remove code from ASPX files and create temporary files. Each parser understands only one language. Therefore mixing of languages in a single ASPX file is not possible.
29. Is it possible to see the code that ASP.NET generates from an ASPX file?
By enabling debugging using a <%@ Page Debug="true" %> directive in the ASPX file or a
30. Can a custom .NET data type be used in a Web form?
This can be achieved by placing the DLL containing the custom data type in the application root's bin directory and ASP.NET will automatically load the DLL when the type is referenced.
31. List the event handlers that can be included in Global.asax?
* Application start and end event handlers
* Session start and end event handlers
* Per-request event handlers
* Non-deterministic event handlers
32. Can the view state be protected from tampering?
This can be achieved by including an @ Page directive with an EnableViewStateMac="true" attribute in each ASPX file that has to be protected. Another way is to include the
33. Can the view state be encrypted?
The view state can be encrypted by setting EnableViewStateMac to true and either modifying the
34. When during the page processing cycle is ViewState available?
The view state is available after the Init() and before the Render() methods are called during Page load.
35. Do Web controls support Cascading Style Sheets?
All Web controls inherit a property named CssClass from the base class System.Web.UI.WebControls.WebControl which can be used to control the properties of the web control.
36. What namespaces are imported by default in ASPX files?
The following namespaces are imported by default. Other namespaces must be imported manually using @ Import directives.
* System
* System.Collections
* System.Collections.Specialized
* System.Configuration
* System.Text
* System.Text.RegularExpressions
* System.Web
* System.Web.Caching
* System.Web.Security
* System.Web.SessionState
* System.Web.UI
* System.Web.UI.HtmlControls
* System.Web.UI.WebControls
37. What classes are needed to send e-mail from an ASP.NET application?
The classes MailMessage and SmtpMail have to be used to send email from an ASP.NET application. MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's System.Web.Mail namespace.
38. Why do some web service classes derive from System.Web.WebServices while others do not?
Those Web Service classes which employ objects like Application, Session, Context, Server, and User have to derive from System.Web.WebServices. If it does not use these objects, it is not necessary to be derived from it.
39. What are VSDISCO files?
VSDISCO files are DISCO files that enable dynamic discovery of Web Services. ASP.NET links the VSDISCO to a HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.
40. How can files be uploaded to Web pages in ASP.NET?
This can be done by using the HtmlInputFile class to declare an instance of an tag. Then, a byte[] can be declared to read in the data from the input file. This can then be sent to the server.
41. How do I create an ASPX page that periodically refreshes itself?
The following META tag can be used as a trigger to automatically refresh the page every n seconds:
42. How do I initialize a TextBox whose TextMode is "password", with a password?
The TextBox’s Text property cannot be used to assign a value to a password field. Instead, its Value field can be used for that purpose.
43. Why does the control's PostedFile property always show null when using HtmlInputFile control to upload files to a Web server?
This occurs when an enctype="multipart/form-data" attribute is missing in the
Subscribe to:
Posts (Atom)