The controls collection cannot be modified because the control contains code blocks(i.e, <%...%>)

StackOverflow https://stackoverflow.com/questions/20241475

Frage

I have this problem which seems to be a common one, I have fixed the said issue but by fixing it I have made another issue and I'm hoping someone knows a way to fix it.

I have images on a webpage which need to resolve the URL before when I had the issue with code blocks it looked like

<td><img src='<%=ResolveUrl("~/")%>content/images/like_icon.png' alt="facebook" /></td>

I changed the <%= to <%# which fixed the code blocks but the image is not loading anymore.

<td><img src='<%#ResolveUrl("~/")%>content/images/like_icon.png' alt="facebook" /></td>

also I have done the same to the JavaScript on the page which has done the same type of thing, the java does nothing anymore!

any ideas on this issue would be a great help!

Thanks

Thomas James

War es hilfreich?

Lösung

Issue Fixed added a Div with runat="server" around all the content which fixed the issue

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top