<% and %> tags? can I use them to dynamically generate content?
-
Hi, Can I use <% = and %> tags to insert ASP.NET code snippets into my HTML? If yes? why doesn't the following code work?
<asp:RadioButton id="<% = r[i]["ID"].ToString() %>" runat="server" />
Also, if I use something like:
<asp:RadioButton id="SomeID" value="<% = r[i]["Value"].ToString() %>" runat="server" />
Any Ideas?
- A programmer's national anthem; "AAAAAHHHHH!!!!"
-
Hi, Can I use <% = and %> tags to insert ASP.NET code snippets into my HTML? If yes? why doesn't the following code work?
<asp:RadioButton id="<% = r[i]["ID"].ToString() %>" runat="server" />
Also, if I use something like:
<asp:RadioButton id="SomeID" value="<% = r[i]["Value"].ToString() %>" runat="server" />
Any Ideas?
- A programmer's national anthem; "AAAAAHHHHH!!!!"
signbit wrote:
Can I use <% = and %> tags to insert ASP.NET code snippets into my HTML?
Yes...
signbit wrote:
" runat="server" />
But what is r in your code? << >>
-
Hi, Can I use <% = and %> tags to insert ASP.NET code snippets into my HTML? If yes? why doesn't the following code work?
<asp:RadioButton id="<% = r[i]["ID"].ToString() %>" runat="server" />
Also, if I use something like:
<asp:RadioButton id="SomeID" value="<% = r[i]["Value"].ToString() %>" runat="server" />
Any Ideas?
- A programmer's national anthem; "AAAAAHHHHH!!!!"
Try this: <%String val=r[i]["ID"].ToString();> <asp:RadioButton id="SomeID" value="<%=val%>' runat="server" /> If this does not work, use double quotes instead on single quotes. r must be a public member.
Regards, Arun Kumar.A