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
相关问答:
前段时间碰到一道面试题如下:
test.aspx页面有如下代码:
Response.Write(Test.GetDate());
Test类如下:
public class Test
{
static string dt="";
public static s ......
RT。很多地址都打不开或不能下载了
有资源的朋友给个地址。。只要下载后是我想要的内容 50分献上!
谢谢!
沙发我先坐!
帮顶
帮顶
没听说过哦
JF
好像19没有的,不全。
好多集都不能下。。
......
如题,我把窗口程序设计成一直在打开网页,然后后台在运行程序,我想问如果用户关闭浏览器,后台能否添加事件处理关闭(主要是释放一些资源)
没有可靠的办法。
浏览器是什么?假设你在浏览器地址栏上打入“ ......
在弹出框中点击一个按钮,怎么调转到另一个浏览器,并且在该浏览器打开两个页面
你的意思应该是
response.write("<script>alert('确认'); window.location.href('xxxx.aspx'); </script>"); ......