Archive for the ‘.NET’ Category

Dynatree Lazy Load Example With asp.net

I faced issue on my work we use jquery Dynatreeat one of our projects and for performance issue i decide to use the lazy load feature that comes with Dynatree Plugin ,but i found no example in asp.net to how to achieve this. So i made an example and will go in details how to […]

More »

Implementing Custom Log4Net using AdoNetAppender and simple Wrapper with Asp.Net Mvc

Assalamo Alikom This post comes after a quite long pause, but I found this very useful article which encouraged me to write in this topic. In this post i will Illustrate how to make Wrapper class(mimic structure, but simply hide complexity/advanced/unwanted functionality) to manage Log4net Classes in an manageable and easy way . First Log4Net […]

More »

Using Log4net for logging with asp.net and MVC log into SQL Table

I will write this article to show how to use Log4net with MVC. First you need to read about Log4net And for shower log4net is one of the best solutions for logging. Now let us start 1) Download the Dlls from the site. 2) Add reference to it into your project. 3) Create The table […]

More »

Calculate the number of days between two dates in C#

Simple way to Calculate the date the separtates two dates . DateTime date1 = DateTime.Now.AddDays(1), date2 = DateTime.Now;             Console.WriteLine((date1 – date2).TotalDays);             Console.WriteLine((date1 – date2).TotalHours);             Console.WriteLine((date1 – date2).TotalMinutes);             Console.WriteLine((date1 – date2).TotalSeconds);   […]

More »

How To Assign Data To All Models Objects And Pass Common Data To View

First let’s answer this question. In what order are filters executed in asp.net MVC? Answer 1) Authorization filters. 2) Action filters. 3) Response filters. 4) Exception filters. We will talk about Action Filters We will find 4 override method when inherits this class “System.Web.Mvc.ActionFilterAttribute” and there order on execution is. OnActionExecuting OnActionExecuted OnResultExecuting OnResultExecuted In […]

More »

Visual Studio 2012 JavaScript Snippet JQuery (ajax call function)

this snippet for add ajax java script function <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">   <CodeSnippet Format="1.0.0">     <Header>       <Keywords>         <Keyword>JAjaxCall</Keyword>       </Keywords>       <SnippetTypes>         <SnippetType>Expansion</SnippetType>       </SnippetTypes>       <Title>JAjaxCall</Title>       <Author>ELMansy</Author>     […]

More »

Visual Studio 2012 JavaScript Snippet JQuery (ready function)

I will show today a simple snippet to make JQuery Document Ready function <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">   <CodeSnippet Format="1.0.0">     <Header>       <SnippetTypes>         <SnippetType>Expansion</SnippetType>       </SnippetTypes>       <Title>SnippetFile1</Title>       <Author>ELMansy</Author>       <Description>       </Description>     […]

More »

Visual C# Code Snippets vs2012 (Make Function Snippet)

This is my code for the Snippet file to make a function . <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">   <CodeSnippet Format="1.0.0">     <Header>       <SnippetTypes>         <SnippetType>Expansion</SnippetType>       </SnippetTypes>       <Title>Mansy_Func</Title>       <Author>ELMansy</Author>       <Description>       </Description>     […]

More »

Visual C# Code Snippets vs2012

This is the my first post on C# Code Snippet. Code Snippets is a very handy feature inside Visual Studio there is of course defulat code snippets like, “try,for,foreach,do,enum” i found them very helpful. The cool thing is that you can create your Owen Snippet. First : where to found visual studio snippet “%ProgramFiles(x86)%\Microsoft Visual Studio […]

More »

Send Email Using Google OAuth (via SMTP) using 2-legged OAuth

I Waited for a long time to write this post, and was just waiting for the right time. Let us start, with some basics OAuth is new technology to make it easier to connect to service without the need to write USERNAME and PASSWORD each time, or to give them to each client program you […]

More »