期待一个“”或无效的 '/'
这可能是非常简单的事情,我看不见,但给出的错误太模糊,无法告诉我该去哪里查看。
这行告诉我它正在期待 ';'
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
我正在使用 VS2010,MVC 2,并且我正在使用此行调用部分视图(ascx 文件)
<%Html.RenderPartial("problemPage");%>
但是对于调用我得到的页面的此行,错误 CS1525:无效的表达式术语 '/'
这是部分视图中的内容(problemPage) 这应该是问题所在。
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<style type="text/css">
a.navfooter:link {color: #19abdc; text-decoration: underline; }
a.navfooter:visited {color: #19abdc; text-decoration: underline; }
a.navfooter:hover {color: #19abdc; text-decoration: underline; }
a.navquicklinks:active {color: #19abdc; }
</style>
<table width="170" border="0" align="center">
<tr>
<td align="center"><h1><a href="../about-this.php"><img src="<%: Url.Content(~/Content/Images/banner_left.gif) %>" width="120" height="600" border="0" /></a></h1>
<p> </p>
</td>
<td align="center"><img src="<%: Url.Content(~/Content/Images/ss.gif) %>" width="11" height="11" /></td>
</tr>
</table>
我不知道无效的“/”在页面中的位置,以及期望的“;”已经在另一页了,请帮忙。我觉得这应该是一个快速修复,但我还没有看到我的语法错误在哪里。
This is probably something really simple that I am blind to see, but the errors being given are to vague to tell me where to look.
This line is telling me it is expecting ';'
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
I am using VS2010, MVC 2, and I am calling a parial view(ascx file) with this line
<%Html.RenderPartial("problemPage");%>
However for this line that calls the page I get, error CS1525: Invalid expression term '/'
Here is what is in the partial view(problemPage) that is supposedly where the problem is.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<style type="text/css">
a.navfooter:link {color: #19abdc; text-decoration: underline; }
a.navfooter:visited {color: #19abdc; text-decoration: underline; }
a.navfooter:hover {color: #19abdc; text-decoration: underline; }
a.navquicklinks:active {color: #19abdc; }
</style>
<table width="170" border="0" align="center">
<tr>
<td align="center"><h1><a href="../about-this.php"><img src="<%: Url.Content(~/Content/Images/banner_left.gif) %>" width="120" height="600" border="0" /></a></h1>
<p> </p>
</td>
<td align="center"><img src="<%: Url.Content(~/Content/Images/ss.gif) %>" width="11" height="11" /></td>
</tr>
</table>
I have no idea where the invalid '/' would be in the page, and the expect ';' is already in the other page, please help. I feel like this should be a quick fix, but I have yet to see where my syntax error is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
Url.Content(...)
未用引号引起来。 EG应该是
Your
Url.Content(...)
are not wrapped in quotes. E.G.should be