开发者

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

开发者 https://www.devze.com 2023-03-27 11:00 出处:网络
I am getting the error Parser Error Message: The server tag is not well formed. on the code line below:开发者_JS百科

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

精彩评论

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