Home
ASP.Net
Interview FAQs

ASP.NET Web Forms uses Page controller pattern approach for rendering layout. In this approach, every page has it is own controller i.e. code-behind file that processes the request. On the other hand, ASP.NET MVC uses Front Controller approach. In this approach a common controller for all pages, processes the requests.

Global.asax is basically ASP.NET Application file. It’s a place to write code for Application-level events such as Application start, Application end, Session start and end, Application error etc. raised by ASP.NET or by HTTP Modules.

There is a good list of events that are fired but following are few of the important events in Global.asax:

  • Application_Init occurs in case of application initialization for the very first time.
  • Application_Start fires on application start.
  • Session_Start fires when a new user session starts
  • Application_Error occurs in case of an unhandled exception generated from application.
  • Session_End fires when user session ends.
  • Application_End fires when application ends or time out.

The list below shows a few of the new features introduced in ASP.Net 4.0 -

  1. Optional and Named Parameters
  2. COM Interoperability Enhancements
  3. Covariance and Contra-variance
  4. Dynamic Type Introduction

When we have to post data from one page to another in application we used server.transfer method but in this the URL remains the same but in cross page posting there is little different there is normal post back is done but in target page we can access values of server control in the source page.This is quite simple we have to only set the PostBackUrl property of Button, LinkButton or Imagebutton which specifies the target page.In target page we can access the PreviousPage property.And we have to use the @PreviousPageType directive.We can access control of PreviousPage by using the findcontrol method.When we set the PostBackURL property ASP.NET framework bind the HTML and Javascript function automatically.
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.
Inline code is written along side the HTML in .aspx page means your c# code (server side script and html and server controls exists in the same page). Code-behind is code written in a separate file like .aspx.cs or .aspx.vb  and referenced by the .aspx page.

ASP.Net stands for Active Server Pages .Net.

ASP.Net is an open source server-side Web application framework designed for Web development to produce dynamic Web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.

It was first released in January 2002 with version 1.0 of the .Net Framework, and is the successor to Microsoft(s) Active Server Pages (ASP) technology. ASP.Net is built on the Common Language Runtime (CLR), allowing programmers to write ASP.Net code using any supported .Net language. 

  • ASP.Net pages are compiled, which makes them faster than Classic ASP.
  • ASP.Net has better language support, a large set of user controls, XML-based components, and integrated user authentication.
  • ASP.Net pages have the extension .aspx, and are normally written in VB (Visual Basic) or C# (C-Sharp).
  • User controls in ASP.NET can be written in different languages, including C++ and Java.

When a browser requests an ASP.NET file, the ASP.NET engine reads the file, compiles and executes the scripts in the file, and returns the result to the browser as plain HTML.

Yes. Any COM component you have deployed today can be used from managed code, and in common cases the adaptation is totally automatic.

Specifically, COM components are accessed from the .NET Framework by use of a runtime callable wrapper (RCW). This wrapper turns the COM interfaces exposed by the COM component into .NET Framework-compatible interfaces. For OLE automation interfaces, the RCW can be generated automatically from a type library. For non-OLE automation interfaces, a developer may write a custom RCW and manually map the types exposed by the COM interface to .NET Framework-compatible types.

Yes. Managed types you build today can be made accessible from COM, and in the common case the configuration is totally automatic. There are certain new features of the managed development environment that are not accessible from COM. For example, static methods and parameterized constructors cannot be used from COM. In general, it is a good idea to decide in advance who the intended user of a given type will be. If the type is to be used from COM, you may be restricted to using those features that are COM accessible.

Depending on the language used to write the managed type, it may or may not be visible by default.

Specifically, .NET Framework components are accessed from COM by using a COM callable wrapper (CCW). This is similar to an RCW (see previous question), but works in the opposite direction. Again, if the .NET Framework development tools cannot automatically generate the wrapper, or if the automatic behavior is not what you want, a custom CCW can be developed.

Yes. Using platform invoke, .NET Framework programs can access native code libraries by means of static DLL entry points.


using System;

using System.Runtime.InteropServices; 

class MainApp 

    [DllImport("user32.dll", EntryPoint="MessageBox")] 

    public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);  

    public static void Main() 

    { 

        MessageBox( 0, "Hello, this is PInvoke in operation!", ".NET", 0 );

    } 

}

PreviousDisplaying 33 of 46Next
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*