N
Nathan Sokalski
I have the following tag in one of my DataList's ItemTemplates:
<asp:ImageButton ID="btnViewQuestion" runat="server" BorderWidth="0"
ImageUrl="images/qmark.gif" Height="27px" Width="26px"
OnClientClick="window.open(<%#
DataBinder.Eval(Container.DataItem,"questionid","'viewquestion.aspx?questionid={0}'")
%>,'question','scrollbars=yes,width=630,height=480,location=no,menubar=no,status=no,toolbar=no');"/>
As you can see, my goal is to use the value from the DataBinding Expression
as the first parameter of a JavaScript window.open() method in the
OnClientClick property of an ImageButton. However, when I run the
application using this, I recieve the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: The server tag is not well formed.
I tried to be careful using the single and double quotes, but I think
everything is correct. Did I do something wrong in this server tag? All my
other DataBinding Expressions work fine when I remove this tag, and the
error says the problem is in this line, so what's the problem? Thanks.
<asp:ImageButton ID="btnViewQuestion" runat="server" BorderWidth="0"
ImageUrl="images/qmark.gif" Height="27px" Width="26px"
OnClientClick="window.open(<%#
DataBinder.Eval(Container.DataItem,"questionid","'viewquestion.aspx?questionid={0}'")
%>,'question','scrollbars=yes,width=630,height=480,location=no,menubar=no,status=no,toolbar=no');"/>
As you can see, my goal is to use the value from the DataBinding Expression
as the first parameter of a JavaScript window.open() method in the
OnClientClick property of an ImageButton. However, when I run the
application using this, I recieve the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: The server tag is not well formed.
I tried to be careful using the single and double quotes, but I think
everything is correct. Did I do something wrong in this server tag? All my
other DataBinding Expressions work fine when I remove this tag, and the
error says the problem is in this line, so what's the problem? Thanks.