开发者

html parser error message: Parser Error Message: The server tag is not well formed

I am getting the error Parser Error Message: The server tag is not well formed. on the code line below:

开发者_JS百科
<asp:HyperLink ID="imgFileType" ImageUrl="images/Icon_Pdf.gif" NavigateUrl='<%#"javascript:ViewFile('erg_", Eval("DocumentName") %>' runat="server"></asp:HyperLink>     

I need the url link to be parsed as:

javascript:ViewFile('erg_Invoice_3200_QRG_Restaurant.pdf');

What am I missing in the syntax?


You cannot do that. The single quote double quote mess will make the compiler complain.
Please write a helper.

Markup

NavigateUrl='<%# SetNavigateUrl(Eval("DocumentName")) %>'>

Code-Behind

protected string SetNavigateUrl(object objName)
{
    return String.Format("javascript:ViewFile('erg_{0}');", objName.ToString());
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜