在虚拟主机上发布的MVC程序路由有问题 可以参看 http://www.cnpowershell.net (非广告)只有首页可以访问,其它页面都是无法找到该页请高手指点,谢谢!具体设置是参考 http://www.cnblogs.com/sonven/archive/2009/11/02/composite_AspNet_MVC.html 的
解决方案 »
- 作業逾時,有什麽辦法解決
- ●●●●20个QQ币 求代码●●●●
- Ajax問題!
- 页面刷新后出现问题
- vs2005中如何设置控件自由拖放
- 为什么我的.net快速入门不能用?
- 有关这条语句的问题:<%@ Page Language="vb" AutoEventWireup="false" Codebehind="A_11.aspx.vb" Inherits="LANNET.A_11"%>
- 运行ASP时出现HttpException异常,System.Web.Util.Transactions.InvokeTransacted好像有问题,如何解决
- 在非Page或UserControl上下文中如何控制Page或UserControl中的UserControl?
- 在asp.net中使用组件的问题?
- ASP是否直接就能在ASP。net里运行!!!
- 急求asp.net在Datalist中自定义分页(VB语言)。。
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using PowerShell.Codes;
namespace PowerShell
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801 public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
); } protected void Application_Start()
{
ViewEngine engine = new ViewEngine();
engine.IsTrace = true; //是否显示请求信息,发布时候请删除此行
ViewEngines.Engines.Add(engine); RegisterRoutes(RouteTable.Routes);
}
}
}
routes.MapRoute(
"Default", // Route name
"{controller}.mvc/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults