Mohamed Salah

/Mohamed Salah

About Mohamed Salah

This author has not yet filled in any details.
So far Mohamed Salah has created 14 blog entries.

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 [...]

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 [...]

Login via Twitter inside your application step by step

By |2012-07-15T12:24:52+00:00July 15th, 2012|Categories: Programming|

In this blog post i am going to explain how to login via twitter inside your web application step by step Introduction: Twitter uses OAuth to provide authorized access to its information and data which gives Secure - Users are not required to share their passwords with 3rd party applications, increasing account security. Standard - A wealth of client libraries and example code are compatible with Twitter's OAuth implementation. We are going to use Twitterizer for Twitter. Implementation: Create twitter application in order to connect to twitter with Go to Create a new application in twitter After creation completed successfully twitter [...]

How to authenticate to FaceBook Graph Api – Part III

By |2012-06-13T09:54:07+00:00June 13th, 2012|Categories: Programming|

As I mentioned in the previous post we are going to complete how to connect to facebook graph Api programatically We are going to create a new web application and name it ConnectToFacebook In Default.aspx page we are going to but the login to facebook button and a label to show up the accesstoken after successfully login in code behind we implementing the code to connect to facebook protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(Request["code"])) { Dictionary<string, string> facebookAccessToken = GetAccessTokenFromRequest(HttpContext.Current.Request.QueryString["code"], ConfigurationManager.AppSettings["FacebookRedirectUri"]); if (!string.IsNullOrWhiteSpace(facebookAccessToken["access_token"])) { lblAccessToken.Text = "Facebook Access Token: " + facebookAccessToken["access_token"]; lnkLoginToFaceBook.Visible = false; } } } protected void [...]

How to authenticate to FaceBook Graph Api – Part II

By |2012-05-13T15:10:52+00:00May 13th, 2012|Categories: Programming|

As I mentioned in the previous post we are going to complete the basic information on how to authenticate Facebook Graph Api In this post I will show you how to authenticate users via simple url requests without any programming language just to explain how are things going. After creating Facebook Application as mentioned in the previous post you can request Facebook authentication dialog as following https://www.facebook.com/dialog/oauth? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL When invoking Facebook login dialog, you must pass in your app id that is generated when you create your application that we mention before (the client_id parameter) and the URL that the user's browser will be redirected [...]

How to authenticate to FaceBook Graph Api – Part I

By |2012-04-30T09:52:18+00:00April 30th, 2012|Categories: Programming|

Facebook uses the OAuth 2.0 protocol for authentication and authorization. To begin use Facebook new Graph Api you have first to perform user authentication and authorization. As facebook mention in their documentation there are  two different OAuth 2.0 flows for user login: server-side (know as the authentication code flow in the specification) and client-side (known as the implicit flow). The server-side flow is used whenever you need to call the Graph API from your web server. The client-side flow is used when you need to make calls to the Graph API from a client, such as JavaScript running in a Web [...]