Blog Home  Home Feed your aggregator (RSS 2.0)  
Software Code Help - InterviewQuestionASPNET
Blog
 
# Friday, January 22, 2010

At times users access a resource as though they were someone else. This is known as impersonation. For example, if a web page has no access controls, then any user can access that web page. HTML pages, ASP pages, and components in version 3.0 and earlier can be accessed through two accounts named IUSR_machinename and IWAM_machinename. Both the accounts are set up during IIS installation, and are automatically added to all the folders in every web site on the server.

Anonymous access to a resource in IIS makes the task of identifying a user extremely difficult. But there is no need to authenticate a user in the case of IIS. When IIS receives a request for a web page or other resource that has permission for anonymous access, IIS treats the IUSR_machinename account as the user's account, to access the resources. If the resource requested by the user is an ASP page that uses a COM or COM+ component, that component is executed using the IWAM_machinename account.

In ASP.NET, when impersonation is turned off, the resources can be accessed using a "local system process" account. When impersonation is turned on, ASP.NET executes every resource using the account of a specified user who is authenticated when the user makes the request. If you specify the IUSR_machinename account to be used as the user account, then ASP.NET will behave like previous versions of ASP, in providing access to the resources.

In ASP.NET, you first need to check whether the application is configured to use impersonation. In the case of IIS, the IIS impersonates users with its own IUSR account. In the case of ASP.NET, impersonation is used to decide whether the user's request should be executed using the account of the requested user, or that of a local system-process account that ASP.NET uses for anonymous requests.

The concept of impersonation is complex to some extent due to the fact that ASP.NET uses the dynamic compilation features of the .NET Framework. The IUSR account has only limited permissions on the local machine, and so is not suitable without some reconfiguration. This account is also used by IIS to access resources like HTML pages, documents, and zip files that are not executed as part of the .NET Framework.

If impersonation is enabled in an ASP.NET application then:
• If anonymous access is enabled in IIS, the request is made using the IUSR_machinename account.
• If anonymous access is disabled in IIS, the request is made using the account of the authenticated user.
• In either case, permissions for the account are checked in the Windows Access Control List (ACL) for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.

If impersonation is disabled in an ASP.NET application then:
• If anonymous access is enabled in IIS, the request is made using the system-level process account.
• If anonymous access is disabled in IIS, the request is made using the account of the authenticated user.
• In either case, permissions for the account are checked in the Windows ACL for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.

Friday, January 22, 2010 5:51:33 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Monday, January 18, 2010

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:

o        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.

o        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.

o        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.

Monday, January 18, 2010 6:02:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Tuesday, December 01, 2009

Difference between DataGrid and Grid View is given below:-

Datagrid..
1.Code requires to handle the SortCommand event and rebind grid required.
2.Code requires to handle the PageIndexChanged.
3.Need extensive code for update operation on data.
4.When compared to gridview less events supported.

Grid View : ..
1.No code required.
2.No code required for PageIndexChanged.
3.Needs little code for update operation.
4.GridView supports events fired before and after database updates

Tuesday, December 01, 2009 11:34:14 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Thursday, November 19, 2009
  1. Separation of Code from HTML
    To make a clean sweep, with ASP.NET you have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate efficiently. This makes it much easier for teams of programmers and designers to collaborate efficiently.
  2. Support for compiled languages
    developer can use VB.NET and access features such as strong typing and object-oriented programming. Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code. ASP.NET pages are precompiled to byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is cached until the source changes.
  3. Use services provided by the .NET Framework
    The .NET Framework provides class libraries that can be used by your application. Some of the key classes help you with input/output, access to operating system services, data access, or even debugging. We will go into more detail on some of them in this module.
  4. Graphical Development Environment
    Visual Studio .NET provides a very rich development environment for Web
    developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And you have full IntelliSense support, not only for your code, but also for HTML and XML.
  5. State management
    To refer to the problems mentioned before, ASP.NET provides solutions for session and application state management. State information can, for example, be kept in memory or stored in a database. It can be shared across Web farms, and state information can be recovered, even if the server fails or the connection breaks down.
  6. Update files while the server is running!
    Components of your application can be updated while the server is online and clients are connected. The Framework will use the new files as soon as they are copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished.
  7. XML-Based Configuration Files
    Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can also easily copy these to another server, along with the other files that comprise your application.
Thursday, November 19, 2009 10:27:53 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Tuesday, August 11, 2009
In case, when you are facing colspan problem in datagarid paging section, then use this code to correcting colspan problem.
 
protected void dGrid_PreRender(object sender, EventArgs e)
        {
            try
            {
                DataGrid dgSidDetails = (DataGrid)sender;
                //Fix for numbering being in a left aligned column
                //For some reason, the ColumnSpan property is ignored andnot rendered
                    //unless set using the Attributes
                    if (dgSidDetails.AllowPaging == true && dgSidDetails.AutoGenerateColumns ==    false)
                    {
                        //Get the Table
                        System.Web.UI.WebControls.Table tab =
                            (System.Web.UI.WebControls.Table)dgSidDetails.Controls[0];
                        //Change the Top Pager
                        if (dgSidDetails.PagerStyle.Position == PagerPosition.Bottom ||
                            dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
                        {
                            tab.Rows[tab.Rows.Count -
                                1].Cells[0].Attributes.Add("colspan",
                                tab.Rows[1].Cells.Count.ToString());
                        }
                        //Change the Bottom Pager
                        if (dgSidDetails.PagerStyle.Position == PagerPosition.Top ||
                            dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
                        {
                            tab.Rows[0].Cells[0].Attributes.Add("colspan",
                                tab.Rows[1].Cells.Count.ToString());
                        }
                    }
            }
            catch (Exception ex)
            {

            }
        }
Tuesday, August 11, 2009 12:29:41 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Thursday, July 09, 2009

ASP.NET provides the following additional benefits:

Simplified development: ASP.NET offers a very rich object model that developers can use to reduce the amount of code they need to write.

Language independence: ASP pages must be written with scripting. In other words, ASP pages must be written in a language that is interpreted rather than compiled. ASP.NET allows compiled languages to be used, providing better performance and cross-language compatibility.

Simplified deployment: With .NET components, deployment is as easy as copying a component assembly to its desired location.

Cross-client capability: One of the foremost problems facing developers today is writing code that can be rendered correctly on multiple client types. For example, writing one script that will render correctly in Internet Explorer 5.5 and Netscape Navigator 4.7, and on a PDA and a mobile phone is very difficult, if not impossible, and time consuming. ASP.NET provides rich server-side components that can automatically produce output specifically targeted at each type of client.

Web services: ASP.NET provides features that allow ASP.NET developers to effortlessly create Web services that can be consumed by any client that understands HTTP and XML, the de facto language for inter-device communication.

Performance: ASP.NET pages are compiled whereas ASP pages are interpreted. When an ASP.NET page is first requested, it is compiled and cached, or saved in memory, by the .NET Common Language Runtime (CLR). This cached copy can then be re-used for each subsequent request for the page. Performance is thereby improved because after the first request, the code can run from a much faster compiled version.

Thursday, July 09, 2009 7:19:56 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ASP.NET  | 
Copyright © 2010 SoftwareCodeHelp. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: