ASP.NET MVC3 includes 3 new “ActionResult” Types. HttpNotFoundResult RedirectResult HttpStatusCodeResult HttpNotFoundResult: Instance of HttpNotFoundResult class indicates to client(browser) that the requested resource was not found. It returns a 404 HTTP status code to the client. Generally we return 404 status code if a requested webpage is not available. In case of MVC applications we 404…
ASP.NET
How to manage the controller’s session state? Simply we can decorate the controller class with ‘SessionState’ attribute. [SessionState()] attribute accepts SessionStateBehaviour enumeration. SessionStateBehaviour enumeration has the following constants:
ASP.NET MVC provides many built-in HTML Helpers. With help of HTML Helpers we can reduce the amount of typing of HTML tags for creating a HTML page. For example we use Html.TextBox() helper method it generates html input textbox. Write the following code snippet in MVC View:
Hi Everyone, Daily .NET Tips is aiming to sharing useful coding tips and tricks for .NET Developers. This site completely design for sharing Tips and Tricks, useful Code Snippet which anyone use in daily development work and targeted anything related with .NET. Lets put a few frequently interesting tips which we have already published over…
Action Filters are available from ASP.NET MVC 2. Action Filters are the attributes used to apply pre processing or post processing logic on the Action methods and Action Results declarative fashion (i.e.: before executing an action method or after executing action method , before returning an action result or after returning action result). For example…
My Presentation on Understanding the ASP.NET MVC in MUGH Community Meet in Microsoft Hyderabad.
Hi, Today ScottGu announced so many exciting products. ASP.NET MVC 3 (Download) NuGet (Download) IIS Express 7.5 (Download) SQL Server Compact Edition 4 (Download) Web Deploy and Web Farm Framework 2.0 (Download) Orchard 1.0 (Download) WebMatrix 1.0 (Download)
When we create a page in ASP.NET, Framework internally creates a .NET class. i.e: An instance of System.Web.UI.Page class. All the content in ASP.NET page including scripts, HTML content and plain text is compiled into .NET class. When a client request for ASP.NET page then ASP.NET Framework searches for a .NET class corresponding to the…
ASP.NET MVC 3 adds great features to MVC 2. View Enhancements Add View Dialog Razor View Engine Controllers Global Filters Dynamic ViewModels New ActionResults JavaScript and AJAX JSON Binding Unobtrusive JavaScript jQuery Validation Model Validation .NET 4 DataAnnotations Improved ValidationAttribute support IValidatableObject Interface support Dependency Injection Improvements Support for Controllers, Views, Action Filters, Model Binders,…
HTTP protocol is stateless protocol. Each time you request a web page from the web server, from a web application perspective, you are a completely new person. HTTP protocol can’t remember the data of a request once it is submitted to the web server so we can’t use the request data of one request in…