Last post Jan 19, 2016 09:08 AM by PatriceSc
Jan 19, 2016 08:57 AM|lolo512|LINK
I wan to add a meta tag to the head dynamically
this is my code
Dim fbTitle As New HtmlMeta
fbTitle.Content = "test"
it throws this error
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
what is wrong.
Thank you in advance for help
Jan 19, 2016 09:07 AM|lolo512|LINK
I found the solution
Dim headTag As New HtmlHead()
Dim metaTag As New HtmlMeta()
metaTag.Content = "test"
Jan 19, 2016 09:08 AM|PatriceSc|LINK
This message is telling you it can't be done if your ASPX markup already uses a <% %> block for this header control. Is this the case?
Edit: use "view source" but here you create a new header control and add the meta to it but the header control for now is not part of the page. So the code doesn't show any error but more likely doesn't do what you want.