2012-10-30 25 views
0

嗨我每次尝试在html中创建按钮时都会收到此错误。 错误: “未终止的字符串常量” 下面的代码:MVC 4,HTML输入标签抛出“未终止的字符串常量”

<input id="topImageNavigationPreviousButton" type="button" value="Previous" class="inline" onclick="location.href='@Url.Action("Index", "Home", new { id = (id + (startIndex - endIndex) + 1) })'"/> 

我使用MVC 4剃刀。 请告诉我,如果你要我发布更多的我的代码:)

(PS:有人可以告诉我,我怎么能断行的代码试图<br/>

回答

0

未结束的字符串常量是东阳缺少结束的引用mark.pretty确保你在语法上犯了一些错误。

onclick="location.href='@Url.Action("Index", "Home", new { id = (id + (startIndex - endIndex) + 1) })'" 
+0

不,没有工作,和之后(的startIndex -endIndex)的托架有+ 1 :( – Graknol

+0

WATS第三参数'新{ID =(ID +(的startIndex - endIndex的)+ 1)'对于? –

+0

这是为了获得下一个图像索引 – Graknol