ASP.NET MVC Release Candidate 1

January 29, 2009

(0) Comments

Finally ASP.Net MVC Release Candidate 1 is ready for download before the version 1 expeceted to be release next month. Its been more than a year since CTP release on 2007-12-10 and i been try it out since preview 5 release.

For beginners, Stephen Walther have posted excellent articles and tutorials to get started. If you already following ASP.Net MVC for sometimes then you should read these blog posts on RC 1.

BALA SINGAM

, ,


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

BaLs Twitter Weekly Updates for 2009-01-25

January 25, 2009

(0) Comments

  • Found a Solution at “Using ASP.NET MVC with Different Versions of IIS : The Official Microsoft ASP.NET Site” ( http://tinyurl.com/6kspcw ) #

Powered by Twitter Tools.

SQL Basic #2 : How to update a table with values from another table

January 25, 2009

(0) Comments

Disclaimer : This tutorial is meant for beginners and for anyone who find it useful. The main purpose of this post to keep everything i find useful for future reference for myself and for others.

Update statement one of most common statement in developers daily routine but sometimes you will come across situation where you need update certain fields a table with values from other tables. Recently i came across this situation so i decided to share the sql statement with others throught this blog.

Example

I will update unitprice field of salesorderdetail table with the value of listprice field from product table using inner join where product.productid=salesorderdetail.productid, this is how the statement look like

update salesorderdetail
set unitprice=product.listprice
from salesorderdetail inner join product
on salesorderdetail.productid=product.productid

BALA SINGAM

, , ,


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Running ASP.Net MVC on IIS 5.1

January 23, 2009

(3) Comments

When i start to create my first ASP.Net MVC application and try run it on IIS 5.1 ( Win XP) i faced problems as it could not run as its run on the project run mode. There was 2 particular problem , first the home page does not apply the CSS or formating and second problem u cannot navigate to other pages because the controller throw “Page cannot be found” error.

CSS and formatting not applied

First problem CSS and formating not applied.

Controller throw error

Second problem controller throw “Page cannot be found” error

I tried few solutions that i found after googling before but non of them work and leave this problem for while. This including  doing some configuration changes in IIS to add .MVC handler but that’s not worked either.  Today i googled again to find solution for this and found a solution given by Ajit Shekhawat. You can access the solution page at CodeProject.

There is 2 things suggested by Ajit Shekhawat to solve this problem , i tried and its worked for me :) . First step is to modify Page_Load() function on Default.aspx.cs file according the code below .

public void Page_Load(object sender, System.EventArgs e)
{
if (Request.ApplicationPath == “”)
{
HttpContext.Current.RewritePath(Request.ApplicationPath + “home.aspx”);
}
else if (Request.ApplicationPath == HostingEnvironment.ApplicationVirtualPath)
{
HttpContext.Current.RewritePath(Request.ApplicationPath + “/home.aspx”);
}
else
{
HttpContext.Current.RewritePath(Request.ApplicationPath);
}
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
}

Second step is to modify RegisterRoutes function on Global.aspx.cs as below , (added “.aspx” as extension to controller)

public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
routes.MapRoute(“Default”, “{controller}.aspx/{action}/{id}”,
new { controller = “Home”, action = “Index”, id = “” });
}

These modification must be done on project file and publish your project on IIS 5.1 and its should work as its works for me :) . The only drawback of these changes is your home controller would have .aspx extension on it and looks weird, see url below.

http://localhost/mvc/Home.aspx/About

Credit for this solution must go to Ajit Shekhawat and original solution can be found at CodeProject

Update

Official solution from Microsoft can be found at ASP.Net page.

BALA SINGAM

,


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

BaLs Twitter Weekly Updates for 2009-01-11

January 11, 2009

(0) Comments

  • Bought Cyber Shot H-50 yesterday! #
  • writing Statement of Purpose “unnei ninaichi parkepothe kavithaiya kothuthe annal athe elethe ninaikipothe varthei mothethe” #

Powered by Twitter Tools.