I was having problems inserting a string into the following tag :
<tr id="rowBulkOptions" style='<%# sBulkOptionsRowStyle %>'>
Don’t ask why I’m using tables 🙂
sBulkOptionsRowStyle is a Public string in the aspx.vb file.
Seemingly the only way I can get this to render is to put
Page.DataBind()
in the Page_Load, Page_PreRender etc.. However this causes me problems because Page.DataBind() binds all controls on the page.
I could use <%= BUT another part of the code inserts controls into the page and apparently you can’t use <%= and insert controls.
Is there a way I can just say ‘look, put sBulkOptionsRowStyle into the page please!’ ?
Thanks.
The
<%#tag is used when binding to a repeating control, I take it this is not what you are doing?As you are dynamically modifying the controls then as you stated you can also not use
<%=.My suggestion would be that you add the tag
runat="server"to your tr and then assign the variable to the Style attribute of the control within the page load/init of your code behind.e.g.
And in code behind