我正在尝试创建一个webform。我在网络表单上添加了一个按钮控件,但是当我切换到设计模式时,我收到了错误: 创建Button1时出错 无法创建Web项目项E:\ MyProjects \ C#\ WebApplication1
有人可以建议解决方案
答案 0 :(得分:2)
您需要删除#字符,因为此字符表示书签。它是一个保留的“特殊角色”,就像?和/是保留的(尽管文件夹名称中也不允许使用这些字符)。
这是一个例子......
<img src="http://localhost/MyApplication/C#/Image1.png" />
此源位置的处理如下。
This part is treated as the location
http://localhost/MyApplication/C
This section denotes a bookmark (just as ? denotes a querystring)
#
This section is the anchor name for the bookmark
/Image1.png
因此,您的图片会尝试加载“http://localhost/MyApplication/C”
以下是一个实际书签的示例,您可以看到它是如何工作的......在测试html文件(称为“test.html”)中弹出它。
<p><a href="test.html#bookmark">Down A Bit</a></p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p>Put some really long content in here...</p>
<p><a name="bookmark"></a>When you click on "Down a Bit",
the page will jump to this location without re-loading the page.</p>
答案 1 :(得分:0)
有人建议从文件夹名称中删除#。它开始工作。但现在的问题是#哪个是causig错误?
答案 2 :(得分:0)
对于路径中包含#char的项目路径,解决方法是删除#char。但是如果您的项目路径没有#con,只需执行卸载项目并在现有解决方案中再次加载,现在当您打开网站时,它将被修复:)