要做一个博客,我使用了DoNetTextBox作为在线编辑器,我添加了一个提交按钮,但是运行时,点了按钮并不会转到事件处理代码,而是出现下面的错误:“/CIS”应用程序中的服务器错误。
--------------------------------------------------------------------------------无法找到资源。
说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。 请求的 URL: /CIS/Default_CuteEditor.aspx
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.832; ASP.NET 版本:2.0.50727.832 文件夹层次是这样的:
CIS\博客\Default_CuteEditor.aspxCIS是项目名,我以为是在线编辑器的问题,换了CuteEditor、DoNetTextBox、FckEditor、FreeTextBox 都是出现这样的问题。第一次做BS项目,请高手解难。
--------------------------------------------------------------------------------无法找到资源。
说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。 请求的 URL: /CIS/Default_CuteEditor.aspx
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.832; ASP.NET 版本:2.0.50727.832 文件夹层次是这样的:
CIS\博客\Default_CuteEditor.aspxCIS是项目名,我以为是在线编辑器的问题,换了CuteEditor、DoNetTextBox、FckEditor、FreeTextBox 都是出现这样的问题。第一次做BS项目,请高手解难。
解决方案 »
- Ajax程序发给别人总是出错,郁闷。
- 新手请教ASP.NET
- 请大家推荐一个可以使用jmail发信的邮件网关?
- 如何实现实时Web系统?有没必要采用推技术??
- 正则表达式问题 在线等
- 第一次用atlas,有点问题请教!
- 将 转换为数据类型 int 时发生算术溢出错误
- 请教一个水晶报表的问题,谢谢高手赐教
- 在线等待:automation服务器不能创建对象!!!
- 为什么我的UrlReferrer总是为空,无法取得上一个页面的url
- 用百度搜索时百度把搜索的中文关键字进行了gb231编码,用js如何把这个gb2312编码还原成汉字
- ASPxGridView中如何才能取到TextBox中的值?急!在线等,可以加分!
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_ad_left" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_content" Runat="Server" EnableViewState="false">
<dntb:webeditor id="WebEditor1" runat="server" EnableViewState="false" ></dntb:webeditor>
<asp:Button runat="server" Text="提交" OnClick="button_submit_Click" EnableViewState="false" />
<asp:TextBox runat="server"></asp:TextBox>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_ad_right" Runat="Server">
</asp:Content>
<%@ Page EnableViewState="false" ViewStateEncryptionMode="never" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default_DoNetTextBox.aspx.cs" Inherits="博客_Default2" Title="Untitled Page" %><%@ Register Assembly="DotNetTextBox" Namespace="DotNetTextBox" TagPrefix="DNTB" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_ad_left" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_content" Runat="Server" EnableViewState="false">
<dntb:webeditor id="WebEditor1" runat="server" EnableViewState="false" ></dntb:webeditor>
<asp:Button ID="button_submit" runat="server" Text="提交" OnClick="button_submit_Click" EnableViewState="false" />
<asp:TextBox ID="textbox_1" runat="server"></asp:TextBox>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_ad_right" Runat="Server">
</asp:Content>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class 博客_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
protected void button_submit_Click(object sender, EventArgs e)
{
Response.Redirect("~/default.aspx");
}
}
母板页代码如下:<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>延安大学校园信息网</title>
<script language="javascript" type="text/javascript"></script>
<link rel="Stylesheet" href="css\MasterPage.css" type="text/css" />
<base href="http://localhost:1456/CIS/"/>
</head>
<body >
<form id="form1" runat="server">
<div id="div_Container" class="Container">
<div id ="div_header" class="header">
<table id="table_log" class="table_log" >
<tr id="tr_LOG">
<!--网站LOG -->
<td id="td_log" style="width: 271px; border-style:groove; color: royalblue; font-family: 华文行楷; font-size:20pt" colspan="" rowspan="2";>
<strong>延安大学校园信息网</strong>
</td>
<!--导航 -->
<td colspan="1" rowspan="2" style="font-size: 15pt; width: 31px; color: royalblue;
border-top-style: groove; font-family: 华文行楷; border-right-style: groove; border-left-style: groove;
border-bottom-style: groove">
</td>
<td style="vertical-align: middle; width: 99px; height: 23px; text-align: center" colspan="" rowspan="">
<a id="hfer_主页" href ="Default.aspx" style="font-size:15px">主
页</a>
</td>
<td id="td_论坛" style="width: 93px; height: 23px; vertical-align: middle; text-align: center;">
<a id="hfre_论坛" href ="论坛\论坛.aspx" style="font-size:15px">论 坛</a>
</td>
<td id="td_登录" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
登 录
</td>
<td id="td_注册" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
注 册
</td>
<td style="vertical-align: middle; width: 99px; height: 23px; text-align: center; font-size: 15px;">
网站地图</td>
</tr>
<tr id="tr_Nagivator">
<td id="td_博客" style="width: 99px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
<a id="href_博客" href="博客\Default_CuteEditor.aspx">博 客</a>
</td>
<td id="td_校园市场" style="width: 93px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
校园市场
</td>
<td id="td_人才广场" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
人才广场
</td>
<td id="td_爱心招领" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
爱心招领
</td>
<td style="vertical-align: middle; width: 99px; height: 23px; text-align: center; font-size: 15px;">
通 知</td>
</tr>
</table>
<hr/>
</div>
<div id="div_main" class="div_main">
<div id="div_ad_left">
<asp:contentplaceholder id="ContentPlaceHolder_ad_left" runat="server" >
</asp:contentplaceholder>
</div>
<div id="div_content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder_content" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="div_ad_right">
<asp:ContentPlaceHolder ID="ContentPlaceHolder_ad_right" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<!--footer -->
<div id="div_footer" class="footer">
<hr />
<p id="info">延安大学校园信息网</p>
</div>
</div>
</form>
</body>
</html>
“/CIS”应用程序中的服务器错误。
--------------------------------------------------------------------------------无法找到资源。
说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。请求的 URL: /CIS/Default_CuteEditor.aspx
-------------------------------------------------------------------------------- 出现这个错误是因为母版页中加了<base href=""/>,其中的href值写错了,根据提供的文件夹结构,
应该写成:<base href="http://localhost:1456/CIS/博客/"/>。
因为是母版页,没有必要写<base href=""/>,建议删掉。另外,提醒下,页面级的视图(EnableViewState="false")已经禁用,有可能会引起某些不良反应。
<!--网站LOG -->
<td id="td_log" style="width: 271px; border-style:groove; color: royalblue; font-family: 华文行楷; font-size:20pt" colspan="" rowspan="2";>
<strong>延安大学校园信息网</strong>
</td>
<!--导航 -->
<td colspan="1" rowspan="2" style="font-size: 15pt; width: 31px; color: royalblue;
border-top-style: groove; font-family: 华文行楷; border-right-style: groove; border-left-style: groove;
border-bottom-style: groove">
</td>
<td style="vertical-align: middle; width: 99px; height: 23px; text-align: center" colspan="" rowspan="">
<a id="hfer_主页" href ="Default.aspx" style="font-size:15px">主
页</a>
</td>
<td id="td_论坛" style="width: 93px; height: 23px; vertical-align: middle; text-align: center;">
<a id="hfre_论坛" href ="论坛\论坛.aspx" style="font-size:15px">论 坛</a>
</td>
<td id="td_登录" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
登 录
</td>
<td id="td_注册" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
注 册
</td>
<td style="vertical-align: middle; width: 99px; height: 23px; text-align: center; font-size: 15px;">
网站地图</td>
</tr>
<tr id="tr_Nagivator">
<td id="td_博客" style="width: 99px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
<a id="href_博客" href="博客\Default_CuteEditor.aspx">博 客</a>
</td>
<td id="td_校园市场" style="width: 93px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
校园市场
</td>
<td id="td_人才广场" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
人才广场
</td>
<td id="td_爱心招领" style="width: 98px; height: 23px; vertical-align: middle; text-align: center; font-size: 15px;">
爱心招领
</td>
<td style="vertical-align: middle; width: 99px; height: 23px; text-align: center; font-size: 15px;">
通 知</td>
</tr>
</table>
<hr/>
</div>
那个取消了也不行。
一般母版页要做成通用型的。不能只考虑某一种因素。
我怎么能在任意一个目录下的页面,跳转到href指向的页面呢?“~/”似乎不管用,而且比如我现在在
CIS\论坛\lutan.aspx页面。要访问CIS\default.aspx,href怎么写才不会出现地址解析错误?
的错误。不过还是很想知道用A href怎么实现任意目录间的页面跳转并且不会出现地址解析错误。
问题已经解决,在此感谢所有参与到本次讨论中的同志,特别感谢xiaoxiaokeren和sp1234,不知两位高人能留下QQ吗,我的463127310,该结贴散分了。
{
FolderBrowserDialog folderDialog = new FolderBrowserDialog();
folderDialog.Description = "选择文件夹"; if (folderDialog.ShowDialog() == DialogResult.OK)
{
btnOpen.Enabled = true;
label6.Text = folderDialog.SelectedPath;
}
}
private void Form1_Load(object sender, EventArgs e)
{
//btnOpen.Enabled = false;
//button2.Enabled = false;
}
{
FolderBrowserDialog folderDialog = new FolderBrowserDialog();
folderDialog.Description = "选择文件夹"; if (folderDialog.ShowDialog() == DialogResult.OK)
{
btnOpen.Enabled = true;
label6.Text = folderDialog.SelectedPath;
}
}
private void Form1_Load(object sender, EventArgs e)
{
//btnOpen.Enabled = false;
//button2.Enabled = false;
}