TIPS & TRICKS

Storing JSON Objects in HTML5 Local Storage

by Shravan Kumar Kasagoni on March 19, 2013

In one my recent application (HTML 5 static mobile app) I have a requirement to persist couple of JSON objects across the application. Earlier, this was done with cookies. With HTML5, web pages can store data locally within the user’s browser using Web Storage. Web Storage is more secure and faster compare to cookies. The [...]

{ 4 comments }

Difference between Html.RenderAction and Html.Action

by Shravan Kumar Kasagoni on August 12, 2012

Html.RenderAction() and Html.Action()  methods   are available in ChildActionExtensions (System.Web.Mvc.Html) class in ASP.NET MVC. Generally both methods are used for calling action methods or child action methods  and rendering the result of action method in view. @Html.Action() – Invokes the specified child action method and returns the result as an HTML string. @{ Html.RenderAction(); } – [...]

{ 1 comment }

Improvements in Razor in ASP.NET MVC 4

by Shravan Kumar Kasagoni on August 10, 2012

First version of razor is shipped with ASP.NET MVC 3. ASP.NET MVC 4 come with Razor V2.0. Razor V2.0 includes some tiny & happy features. URL Resolution Enhancements: We use the relative URL for any resources (images, scripts, css) in code , for example : <script src="~/Scripts/jquery-1.8.2.js"></script> But in runtime we should resolve the full [...]

{ 0 comments }

Return JSON from Action Method in ASP.NET MVC

by Shravan Kumar Kasagoni on May 15, 2012

In my application I am calling an action method from JavaScript & expecting result as JSON. This is pretty simple in ASP.NET MVC, Once we get response object in action method we can call Json() method pass response object as a parameter, then it will transform your response object as JSON & return it as [...]

{ 0 comments }

Daily .NET Tips – Completed 1 Year Today

by Shravan Kumar Kasagoni on December 27, 2011

Friends, We are excited to celebrate 1st Anniversary of our site DailyDotnetTips today. It aims to share useful programming tips 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. Here is some of the statistics : Founded [...]

{ 0 comments }

How to use different name for action method in requested URL in MVC

by Shravan Kumar Kasagoni on November 6, 2011

This articles talks about one simple technique that is when we make request for any resource/data in in server to ASP.NET MVC Web Application, the request is first processed by a method that is action method. Any public & non static method in a controller class is an action method. Every action method inside the [...]

{ 0 comments }

New ViewBag Property in ASP.NET MVC3

by Shravan Kumar Kasagoni on September 18, 2011

Controller in ASP.NET MVC 2 (MVC 3 also) supports property named ViewData. ViewData help us to pass data from controllers to views , in between views using using a late-bound dictionary API. ViewData is property of type ViewDataDictionary in ControllerBase class. ViewData properties are stored as name/value pairs in the ViewData dictionary.

{ 0 comments }

How to allow user to input html in ASP.NET MVC?

by Shravan Kumar Kasagoni on August 24, 2011

Whenever we submit HTML or JavaScript as input in ASP.NET MVC application we get an exception like "A potentially dangerous Request.Form value was detected from the client (……)”. Because ASP.NET MVC has built-in request validation that helps you automatically protect against cross-site scripting (XSS) attacks and HTML injection attacks, it will prevent the user from [...]

{ 1 comment }