render blocks

  • Thread starter Thread starter Jeremy Ames
  • Start date Start date
J

Jeremy Ames

The variable could be out of scope. You are trying to access the variable
that is defined in another block. If you create that variable in the code
behind page instead, you should be able to access it.


Can someone tell me what's wrong with using this to create a textbox?

<%
int width=100;
%>
<asp:TextBox runat="server" id="boom" width="<%=width%>"></asp:TextBox>


Thanks,
Temo
 
asp.net does not support <%= value %> syntax inside a server control tag
(any tag with runat=server). <%= value %> is a shortcut for
<%Response.Write(value) %>, which makes no sense inside a server tag.

on the other hand, the eval tag <%# expression %> is allowed in a server
tag.

-- bruce (sqlwork.com)
 
If i remember correctly, all variables declared within a render block
are available for use to all other render blocks within the same file.
 
Can someone tell me what's wrong with using this to create a textbox?

<%
int width=100;
%>
<asp:TextBox runat="server" id="boom" width="<%=width%>"></asp:TextBox>


Thanks,
Temo
 
Back
Top