asp.net mvc 网站如何发布?
本人刚接触ASP.net mvc 用的是1.0版本。
我刚做完一个项目,项目在vs中完全正常。
但是发布到IIS后除了首页可以显示外,其他页面上的所有连接点进去都是无法找到网页,还有有些链接是用jQuery ajax读取数据库(linq to sql)然后显示,点了之后也一点反应都没。
首页使用地址重写,代码如下:
C# code:
public void Page_Load(object sender, System.EventArgs e)
{
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
下面是Global.asax 文件中routing规则:
C# code:
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
ro
相关问答:
我在一个ASPX页面中用 <!-- #include file="top.asp"-->嵌套了一个asp页面,但在点击按钮提交表单的时候没有任何反应,是不是两个FORM的原因造成的,top.asp里面也有一个form,把嵌套去掉的话,运行 ......
asp.net repeater 控件怎么可以取到子控件的值,设置断点在 ItemDataBound 事件怎么没有用的
Request.Form["name"]
楼主你要在把repeater中的 一个属性设置一下才能进入itemdatabound事件
可以 ......
谁知道,最好是实例,测试过的更好,谢谢分享;
http://www.92dotnet.com/showtopic-428.aspxC# code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using Sy ......
ASP.NET 错误 无法识别的标记前缀或设备筛选器“asp”
代码如下:
<%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeFile=" ......
测试工程:
Login.aspx
Default.aspx
First.aspx
Second.aspx
web.config
Global.asax
代码:
Login.aspx
C# code:
protected void Submit_Click(object sender, Ev ......