Different types of results in MVC

In MVC there are almost 12 types of result , Actionresult class is the base class and there are eleven sub types are available. a)Viewresult: for returning view only. b)PartialViewResult: It will render a particular partial view result, the best example of it will be like ajax in mvc, in action link, if any one wants…

Read More

Using Asynchronous Methods in ASP.NET MVC 4

In .net 4.5 , there is a new feature is called  asynchronous method calling , action methods that return an object of type  Task<ActionResult> , MVC 4 supports Task based Programming , it is inheriting from namespace called System.Threading.Tasks , The .NET Framework 4.5 builds on this asynchronous support with  the await and async keywords that make working with Task objects which is  much less complex…

Read More

Filters in mvc

there are different types of filters in mvc,the execution of filters below like A)Authorization filters: this filter implements using IAithorizationFilter , it is used to secure action like performing authentication and validationit is used by Authorize attribute , below is the example of using this attribute . [Authorize] public ActionResult Authenticateuser() { return View(); }…

Read More

select text using sp_helptext

it is great tools for selecting whole text of stored procedure,table etc . it is very easy to use for dynamic query without using concatenate . it is also very useful for selecting large sql and use as dynamic. DECLARE @Table TABLE( Val VARCHAR(MAX) ) INSERT INTO @Table EXEC sp_helptext ‘actInvoice_AuditLog’ DECLARE @Val VARCHAR(MAX) SELECT…

Read More

Update Multiple Row using Linq

some time it requires to update multiple record using linq , for selecting single value you have to use Dirstdefault() , but for selecting multiple value you have to use list like below var userId=Convert.ToInt32(outuserId.Value); var res = context.tblCarts.Where(i => i.Cookies_Id == Cartcokie.Value).ToList(); res.ForEach(a => a.User_Id = userId); context.SaveChanges();  …

Read More