State Management Questions

What is View State? View State allows the state of objects (serializable) to be stored in a hidden field on the page. View State is transported to the client and back to the server, and is not stored on the server or any other external source. View State is used the retain the state of server-side objects between postabacks. What is the lifespan for items stored in View State? Item stored in View State exist for the life of the current page. This includes post backs (to the same page). What does the “EnableViewState” property do? Why would I want … Click here to continue…..

MVC Architecture in .Net

This article helps you that how MVC pattern can be used in ASP.NET application & maintain the basic Microsoft supplied architecture. MVC stands for MODEL VIEW CONTROLLER. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner than the traditional ASP.NET web development. Web applications developed with ASP.NET MVC are even more SEO (Search Engine) friendly. The entire ASP.NET MVC architecture is based on Microsoft .NET Framework 3.5 and in addition uses LINQ to SQL Server. What is a Model? MVC model is basically a C# or VB.NET class A model is accessible by both controller … Click here to continue…..

How to call a C# Web(Page) Method from Javascript using ScriptManager

Atlas (Javascript Library) gave us the ability to easily call Web method from JavaScript. Microsoft AJAX has gone one step further! We can now call web methods in the code behind of the current page from Javascript. Here’s how: For Enable Page Methods on your ScriptManager set the EnablePageMethods=”true” attribute

For this you must mark your method as static and give it the Web-method attribute. The method has to be declared static. It must also be marked with the WebMethod attribute. You’ll probably find that you need to include System.Web.Services

For Call it from Javascript you need to call the method from javascript you … Click here to continue…..

What are Action Methods in ASP.NET MVC?

I already explained about request flow in ASP.NET MVC framework that request coming from client hits controller first. Actually MVC application determines the corresponding controller by using routing rules defined in Global.asax. And controllers have specific methods for each user actions. Each request coming to controller is for a specific Action Method. The following code example, “ShowBooks” is an example of an Action method.

Difference between ASP.NET MVC and ASP.NET WebForms?

ASP.NET Web Forms uses Page controller pattern approach for rendering layout, whereas ASP.NET MVC uses Front controller approach. In case of Page controller approach, every page has its own controller, i.e., code-behind file that processes the request. On the other hand, in ASP.NET MVC, a common controller for all pages processes the requests. ASP.NET WebForms ASP.NET MVC Uses the ‘Page Controller’ pattern. Each page has a code-behind class that acts as a controller and is responsible for rendering the layout. Uses the ‘Front Controller’ pattern. There is a single central controller for all pages to process web application requests and … Click here to continue…..