在发布一个网站,在服务器上发布asp.net程序碰到了个问题,就是发布后浏览Login时报错,如下Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
为了找原因,做如下简单的测试
前后台代码如下<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server"> void Page_Load()
{
lblServerTime.Text = DateTime.Now.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>First Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome to ASP.NET 3.5! The current date and time is:
<asp:Label
id="lblServerTime"
Runat="server" />
</div>
</form>
</body>
</html>但是单独右键打开这个文件时(IE方式)时报错如下无法显示 XML 页。
无法查看使用 XSL 样式表的 XML 输入。请更正错误然后单击 刷新 按钮,或稍后重试。
--------------------------------------------------------------------------------名称以无效字符开头。处理资源 'file:///E:/Users/Administrator/Desktop/FirstPage.aspx' 时出错。第 1 行,位置: 2 <%@ Page Language="C#" %>
-^
或者把后缀改成htm时,显示不出当前时间,只显示“Welcome to ASP.NET 3.5! The current date and time is: ”
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
为了找原因,做如下简单的测试
前后台代码如下<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server"> void Page_Load()
{
lblServerTime.Text = DateTime.Now.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>First Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome to ASP.NET 3.5! The current date and time is:
<asp:Label
id="lblServerTime"
Runat="server" />
</div>
</form>
</body>
</html>但是单独右键打开这个文件时(IE方式)时报错如下无法显示 XML 页。
无法查看使用 XSL 样式表的 XML 输入。请更正错误然后单击 刷新 按钮,或稍后重试。
--------------------------------------------------------------------------------名称以无效字符开头。处理资源 'file:///E:/Users/Administrator/Desktop/FirstPage.aspx' 时出错。第 1 行,位置: 2 <%@ Page Language="C#" %>
-^
或者把后缀改成htm时,显示不出当前时间,只显示“Welcome to ASP.NET 3.5! The current date and time is: ”
解决方案 »
- MySQL怎么解决MySql.Data.MySqlClient.MySqlException: Packets larger than max_allow
- 提取别人网站的验证码到我本地的问题!
- Repeater中的Button在点击时如何获得本行的数据源对象
- Web耗时操作时难题
- Repeater中如何添加一个按钮的事件
- 表格的背景色根据rs("ps")的值不同发生变化
- 从下层框架返回上层框架时如何提取上层框架中控件的原来的值?(保证给分)
- 给个小项目生成静态页面的
- ************************请教关于ADO里Recordset的问题**********************
- 在安装过程中(自定义操作)运行自编的程序(VB.Net编写)出错,大家快来关注一下,来者有分!
- linq查询DataSet 或DataTable
- 求助!!急急急~~怎么在ASP.NET中实现:在一个文本框中输入编号,然后从数据库中查询对应的名称显示在另一个文本框中。
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
注:这里的aspx文件中时前后台代码都有的 就像楼主中发的那个代码一样