Programming

/Programming

Why mailchimp-mandrill driving me nuts?

By |2018-08-11T23:02:08+00:00August 11th, 2018|Categories: Programming|Tags: , , |

I have used mailchimp and its API mandrill in couple of projects recently. Both of these projects had requirements to send a relatively complex emails such as confirmations to customers, detailed invoice and account totals which required a strong email template engine to allow sending object list and let the template itself loop through the objects and display them. I found Mandrill and their template engine which you can set it to use Handlebars.js is very powerful and fit my needs pretty well. Because Mailchimp templates design editor is robust and easy to use, we started to build the templates in [...]

React Fundamentals

By |2018-07-03T11:17:43+00:00June 29th, 2018|Categories: Front-end Development, Programming, Web|Tags: , , |

The web has become the dominant programming model of our time, but building rich web applications can become extremely complicated and now a day the need to create reusable UI components is more needed  and React was built to solve one main problem: building large applications with data that changes over time and to simplify the process of building complex UIs. ReactJS Overview In this article React Fundamentals, you will learn foundational knowledge of React. First, you will learn how to structure an application out of components and how to build those components with React. Next, you will discover JSX syntax and [...]

Integrate OpenAuth/OpenID with your existing ASP.NET MVC4 application

By |2012-12-24T15:26:30+00:00December 24th, 2012|Categories: Programming|

In this blog I am going to talk about how to integrate OpenAuth/OpenId with your existing asp.net mvc4 application in Visual studio 2012 Step 1: Create a new project Go to File –> New Project –> Web –> Empty Asp.Net MVC 4 Application Step 2: Add the following libraries Use Nuget to get the following packages DotNetOpenAuth.AspNet This package is the core package for OAuth/OpenID protocol communication Microsoft.AspNet.Providers.Core This package brings in Universal Providers Microsoft.AspNet.Providers.LocalDb This package sets the connectionstring for the Universal Providers Microsoft.AspNet.Membership.OpenAuth This package provides the extension to integrate OAuth/OpenID with Membership providers Step 3: Change web.config to use formsauthentication [...]

Google Charts with MVC3

By |2012-11-25T15:42:23+00:00November 25th, 2012|Categories: Programming|

In this blog I am going to talk about how to add the powerfull Google Charts to your asp.net MVC 3 Application. Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools. Step 1: Create a new project Go to File –> New Project –> Web –> Asp.Net MVC 3 Application Step 2:Javascript files and libraries add the following javascript files to head of your page <script type="text/javascript" [...]

Working examples using Signalr and asp.net MVC3

By |2012-11-25T15:41:36+00:00November 25th, 2012|Categories: Programming|

In this tutorial  I am going to talk about a real examples that we need to implement in most of projects. Step 1: Create Application Go to File --> New Project --> Web --> Asp.Net MVC 3 Application "Internet Application" (Make sure it's .Net Framework 4). Step 2: Add SignalR Package Right click on references and click Manage NuGet Packages. Search for SignalR and click install. Or use NuGet package manager concole and install the SignalR package using Install-Package SignalR Step 3: Add Hub Create a new Class named Chat in a new folder in the solution "Name it as u want" [HubName("chat")] [...]

Creating RSS feed in ASP.net mvc3

By |2012-10-22T14:32:44+00:00October 22nd, 2012|Categories: Programming|

In this toturial we are going through steps to create rss feed from a list of items using .NET’s built in SyndicatedFeed and SyndicatedItem class for content and two classes (Rss20FeedFormatter and Atom10FeedFormatter )  to handle XML generation with correct encoding, formatting and optional fields. Create an empty mvc3 application and name it "RSSFeed.Website" then add Home controller. Create a class and name it NewsItem  this class we will be used as a model for retrieving feed data from the database "i will fill it manually in a the next step " using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace RSSFeed.Website.Models [...]

nopcommerce: How to get Role Name from applied discount coupon?

By |2012-10-11T11:08:02+00:00October 11th, 2012|Categories: Programming|Tags: , , , |

- Create a discount from the cms admin - Add  a requirement for that discount and select "Must be assigned to customer role" and choose a role. The next steps can be done anywhere in the website, I will use the CommonController to show the role name inside the website header beside the user email -  Go to CommonController  and inside the HeaderLinks method add these lines: // Added by treenodes 10 Oct 2012 string discountRoleName = string.Empty; if (discount !=null && discount.DiscountRequirements != null) { var requ = discount.DiscountRequirements.FirstOrDefault(); foreach (var customerRole in customer.CustomerRoles.Where(cr => cr.Active).ToList()) if (requ != null [...]

Quartz.net Schedulling Jobs

By |2012-07-22T10:38:44+00:00July 22nd, 2012|Categories: Programming|

Introduction: Sometimes when you develop an application, you are going to face some tasks needs to perform a certain action at a given time without any user interaction, example for that a User wants to set an alert in specific time to remind him with a date Or something else like updating records in database periodically. All this tasks needs non-human interaction, so how could you tell the machine to do this job ? that's the question. Cron Job is the solution for this tasks. Quartz.net has presented an excellent open source job scheduler that can be used for these purposes. What [...]

Using Signalr with Asp.net MVC to create simple chat application part II

By |2012-07-19T14:09:32+00:00July 19th, 2012|Categories: Programming|

As we mentioned in the previous example here, we can create a simple asynchronous actions with the signalr library like chat, real-time streaming and so on. in this blog i am going to go with another library from signalr its PersistentConnection. A PersistentConnection is the base class that has an api for exposing a SignalR service over http. we are going to complete in the the previous application we created Step 1:Add AdvChatController we are going to create a new controller called AdvChatController with two action methods Index and Adv. then add index view Step 2: Create Signalr PersistentConnection Create a class the [...]

Using Signalr with Asp.net MVC to create simple chat application

By |2012-07-17T13:00:17+00:00July 17th, 2012|Categories: Programming|

In this tutorial I am going to talk about creating a simple chat application using signalr library with asp.net MVC. If we are trying to do a chat application or any asynchronous actions with client so we have a lot of work to do using ajax and javascript. Now with signalr it’s so simple and easy. Step 1: Create an Empty Asp.Net MVC 3 Application Go to File --> New Project --> Web --> Asp.Net MVC 3 Application (Make sure it's .Net Framework 4). Step 2: Add SignalR Package Right click on references and click Manage NuGet Packages. Search for SignalR and click install. Or [...]