문제

<asp:Image ID="imgteacher" runat="server" Height="150" Width="248" ImageUrl="ShowImage.ashx?id="+<%#Eval("CourseID") %>/>

Please, correct my writing mistake . I think my problem is because of only this row, therefore I only copied this row.

Parser Error Message: The server tag is not well formed.
도움이 되었습니까?

해결책

The reason for the error message is the data binding in the ImageUrl attribute. In order to make this work you need to exchange the double quotes by single ones and adjust the data binding code:

<asp:Image ID="imgteacher" runat="server" Height="150" Width="248" 
    ImageUrl='<%# "ShowImage.ashx?id="+ DataBinder.Eval(Container.DataItem, "CourseID") %>'/>

다른 팁

Try This

Simple wadata binding in the ImageUrl attribute

<asp:Image ID="imgteacher" runat="client" Height="150" Width="248" ImageUrl="ShowImage.ashx?id="+<%#Eval("CourseID") %>/>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top