易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关问答:

asp.net分页问题

select top 12 * from Product where [id] not in (select top 12 [id] from Product)
这样可以分页,但是我在后面想加个条件
select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......

asp.net repeater 控件怎么可以取到子控件的值

asp.net repeater 控件怎么可以取到子控件的值,设置断点在 ItemDataBound 事件怎么没有用的
Request.Form["name"]

楼主你要在把repeater中的 一个属性设置一下才能进入itemdatabound事件

可以 ......

asp.net如何把excel导入到sql

谁知道,最好是实例,测试过的更好,谢谢分享;
http://www.92dotnet.com/showtopic-428.aspxC# code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using Sy ......

散粉 正在学习asp.net mvc 很头大

正在学习这个东东 感觉很多地方不是很懂 正在努力 散点粉给asp.net的同仁们 求教好的学习资料 谢谢
参考

asp.net/mvc上有很多内容。 
最近也在看。 
同聊。

JF,3Q


比我有前途, 我至少目前 ......

asp.net form 验证问题

测试工程:
Login.aspx
Default.aspx
First.aspx
Second.aspx

web.config
Global.asax


代码:
Login.aspx
C# code:

protected void Submit_Click(object sender, Ev ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号