TOP

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
TOP

Insert, Update, and Delete Operations – LINQ to SQL

http://msdn.microsoft.com/en-us/library/bb386931.aspx

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 };
cust.Orders.Add(ord);

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

// Removing it from the table also removes it from the Customer’s list.
db.Orders.DeleteOnSubmit(ord0);

// Ask the DataContext to save all the changes.
db.SubmitChanges();

Read More
TOP

ASP.net MVC paging

Client Side Table Sorting, Paging and Filtering with jQuery

http://xlib.wordpress.com/2009/06/29/asp-net-mvc-grid-%E2%80%93-part-2-paging/

http://beckelman.net/post/2008/10/23/Client-Side-Table-Sorting-Paging-and-Filtering-with-jQuery-Demo.aspx

Read More
TOP

ASP.net MVC Strongly Typed Html Helpers

http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2-strongly-typed-html-helpers.aspx

Read More
TOP

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.

Overview

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
TOP

Facebook to your desktop

http://fishbowlclient.com/

Great example with source code.

Read More
TOP

FaceBook Development using C#

http://wiki.developers.facebook.com/index.php/User:C_Sharp

Read More
TOP

ASP.net mvc example

http://www.mvccentral.net/

http://www.mvcstarterkits.net/

Read More
TOP

Developing Facebook applications in C# with ASP.NET

http://www.stevetrefethen.com/blog/DevelopingFacebookApplicationsInCWithASPNET.aspx

Read More
TOP

Eight Key Practices for ASP.NET Deployment

Read More

Switch to our mobile site