Home > Asp.net MVC (Page 4)

Lazy loading in entity framework

One of the biggest issue when we use entity framework that is when we request for one single table you will get all related tables in table object. for example: [crayon-676824ca491e9049963705/]  in above code you will get all related tables in company object. We can avoid this using Lazy loading. for example: [crayon-676824ca491ed647875775/]  in this case you can get only

This Article is TAGGED in , , , , , . Read more

Exception or Error Handling and Logging in MVC4

HandleError Attribute [crayon-676824ca499a7824407379/]   HandleError Attribute at Action Method Level [crayon-676824ca499ab266456178/]   HandleError Attribute at Controller Level [crayon-676824ca499ae674258963/]   HandleError Attribute at Global Level [crayon-676824ca499b0340529956/]   Extending HandleError Filter for logging and handling more errors [crayon-676824ca499b2402997410/]                  

This Article is TAGGED in , . Read more

A Cool New ‘Paste JSON As Classes’ Feature in ASP.NET Web Tools 2012.2 RC

Here’s a simple example:A) Copy to clipboard your JSON object.[crayon-676824ca49b11990847283/] B) In VS2012, open edit menu, choose ‘Past Special’ and click on ‘Past JSON As Classes’.The result:[crayon-676824ca49b14531928809/] Of course it also supports more complex objects like Multi-Dimensional Arrays etc.              

This Article is TAGGED in , . Read more

How to added Script Manager Dynamically before Any Control Need its in asp.net?

The control with ID 'updpnlRightNav' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.   Solution :  1) Add a PlaceHolder on This Page Then ...Create Event on Update Panel OnInit     <asp:PlaceHolderID="pccScriptManager"runat="server"></asp:PlaceHolder>       <asp:UpdatePanelID="updpnlRightNav"runat="server" OnInit="updpnlRightNav_Init"> 2)    protectedvoid updpnlRightNav_Init(object sender, EventArgs e)     {              if (ScriptManager.GetCurrent(Page) == null)             {                 //   

This Article is TAGGED in , . Read more

How to get notification from database when any transaction on records?

Technologies Used: Visual Studio 2013 Express Sql Server 2008 R2 Express MVC 5 Nuget SqlDependency MSDN SignalR 2.0.1 Nuget Jquery 2.0.3 Nuget Toast Notifications Script to Create Broker & Service: create a user called "GeneralUser" with a password of "dbpassword" in your SQl Server logins. Run the following script in a Sql query pane, to create a message broker\service for

This Article is TAGGED in , , , , , , . Read more