Linq to SQL Combine two columns to make a readonly custom column

var rqSaleRepId = from m in db.RequestSaleReps select new { m.RequestSaleRepId, @RepNoWithName=m.SaleRepNo + ” – ” + m.Name};
ViewData[“RequestSaleRepID”] = new SelectList(rqSaleRepId, “RequestSaleRepId”, “RepNoWithName”, editView.RequestSaleRepId);

<%= Html.DropDownList("RequestSaleRepId", (IEnumerable)ViewData[“RequestSaleRepID”])%>

Read More

Insert, Update, and Delete Operations – LINQ to SQL

Northwnd db = new Northwnd(@”c:\Northwnd.mdf”);

// Query for a specific customer.
var cust =
(from c in db.Customers
where c.CustomerID == “ALFKI”
select c).First();

// Change the name of the contact.
cust.ContactName = “New Contact”;

// Create and add a new Order to the Orders collection.
Order ord = new Order { OrderDate = DateTime.Now };

// Delete an existing Order.
Order ord0 = cust.Orders[0];

// Removing it from the table also removes it from the Customer’s list.

// Ask the DataContext to save all the changes.

Read More
TOP MVC paging

Client Side Table Sorting, Paging and Filtering with jQuery

Read More
TOP MVC Strongly Typed Html Helpers

Read More

Model View Control

Model – View – Control

MVC  was first described in 1979 by Trygve Reenskaug, then working on Smalltalk at Xerox PARC. The original implementation is described in depth in the influential paper “Applications Programming in Smalltalk-80: How to use Model–View–Controller”.

There have been several derivatives of MVC. For example, Model View Presenter is used with the .NET Framework[4], and the XForms standard uses a “model-view-controller-connector architecture”. However, standard MVC remains popular.


Though MVC comes in different flavors, control flow is generally as follows:

1.         The user interacts with the user interface in some way (for example, presses a mouse button).

2.         The controller handles the input event from the user interface, often via a registered handler or callback and converts the event into appropriate user action, understandable for the model.

3.         The controller notifies the model of the user action, possibly resulting in a change in the model’s state. (For example, the controller updates the user’s shopping cart.)

4.         A view queries the model in order to generate an appropriate user interface (for example, the view lists the shopping cart’s contents). The view gets its own data from the model. The controller may (in some implementations) issue a general instruction to the view to render itself. In others, the view is automatically notified by the model of changes in state (Observer) which require a screen update.

5.         The user interface waits for further user interactions, which restarts the cycle.

Read More

Facebook to your desktop

Great example with source code.

Read More

FaceBook Development using C#

Read More
TOP mvc example

Read More

Developing Facebook applications in C# with ASP.NET

Read More

Eight Key Practices for ASP.NET Deployment

Read More