找回密码
 FreeOZ用户注册
查看: 2178|回复: 3
打印 上一主题 下一主题

[面试话题] asp .net interview question

[复制链接]
跳转到指定楼层
1#
发表于 22-11-2007 22:07:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
给 nana

#
Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

# What’s the difference between Response.Write() andResponse.Output.Write()?
Response.Output.Write() allows you to write formatted output.

# What methods are fired during the page load?
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

# When during the page processing cycle is ViewState available?
After the Init() and before the Page_Load(), or OnLoad() for a control.

# What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page

# Where do you store the information about the user’s locale?
System.Web.UI.Page.Culture

# What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only.

# What’s a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

# Suppose you want a certain ASP.NET function executed on MouseOver for a certain button.  Where do you add an event handler?
Add an OnMouseOver attribute to the button.  Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

# What data types do the RangeValidator control support?
Integer, String, and Date.

# Explain the differences between Server-side and Client-side code?
Server-side code executes on the server.  Client-side code executes in the client's browser.

# What type of code (server or client) is found in a Code-Behind class?
The answer is server-side code since code-behind is executed on the server.  However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser.  But just to be clear, code-behind executes on the server, thus making it server-side code.

# Should user input data validation occur server-side or client-side?  Why?
All user input data validation should occur on the server at a minimum.  Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.

# What is the difference between Server.Transfer and Response.Redirect?  Why would I choose one over the other?
Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser.  This provides a faster response with a little less overhead on the server.  Server.Transfer does not update the clients url history list or current url.  Response.Redirect is used to redirect the user's browser to another page or site.  This performas a trip back to the client where the client's browser is redirected to the new page.  The user's browser history list is updated to reflect the new address.

# Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Valid answers are:
·  A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
·  A DataSet is designed to work without any continuing connection to the original data source.
·  Data in a DataSet is bulk-loaded, rather than being loaded on demand.
·  There's no concept of cursor types in a DataSet.
·  DataSets have no current record pointer You can use For Each loops to move through the data.
·  You can store many edits in a DataSet, and write them to the original data source in a single operation.
·  Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

# What is the Global.asax used for?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.

# What are the Application_Start and Session_Start subroutines used for?
This is where you can set the specific variables for the Application and Session objects.

# Can you explain what inheritance is and an example of when you might use it?
When you want to inherit (use the functionality of) another class.  Example: With a base class named Employee, a Manager class could be derived from the Employee base class.

# Whats an assembly?
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN

# Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

# Explain what a diffgram is, and a good use for one?
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML.  A good use is reading database data to an XML file to be sent to a Web Service.

# Whats MSIL, and why should my developers need an appreciation of it if at all?
MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL.  MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

# Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The Fill() method.

# Can you edit data in the Repeater control?
No, it just reads the information from its data source.

# Which template must you provide, in order to display data in a Repeater control?
ItemTemplate.

# How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate.

# What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
You must set the DataSource property and call the DataBind method.

# What base class do all Web Forms inherit from?
The Page class.

# Name two properties common in every validation control?
ControlToValidate property and Text property.

# Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
DataTextField property.

# Which control would you use if you needed to make sure the values in two different controls matched?
CompareValidator control.

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

评分

参与人数 2威望 +36 收起 理由
fm_yy + 20 谢谢分享!
nana + 16 哇!

查看全部评分

回复  

使用道具 举报

2#
 楼主| 发表于 22-11-2007 22:08:45 | 只看该作者
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 <FORM... > 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.
回复  

使用道具 举报

3#
发表于 23-11-2007 20:54:44 | 只看该作者
收藏一下,也许以后有用
回复  

使用道具 举报

4#
发表于 4-12-2007 16:40:24 | 只看该作者
不错。
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+11, 29-11-2026 15:29 , Processed in 0.012415 second(s), 21 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表