views:

40

answers:

0

I'm trying to do something like this:

<h1><% =FirstName %></h1>

However, intellisense doesn't show anything when I'm inside the percent brackets, and if I just run it, the resulting web page has not picked up anything inside the percent brackets. I've also tried using other code in the percent brackets, but nothing seems to get picked up.

My work around so far has been to simply response.write the entire line.

Does ASP.Net allow for this type of mixing of html and percent bracketed code on the same line? From the documentation I've seen, I thought it was allowed, but have not been able to get it to work.

UPDATE:

In this code, the first percent brackets does not work, the second does:

<!--Logo-->
<a href='<% =d %>'>
<span style="padding-left:15px;">
<span class="logo">
<span style="color:#000000; letter-spacing:-2px; font:35px Arial, Helvetica, sans-serif;"><% =DomainFirstWord %></span><span style="color:#ff0000; letter-spacing:-1px; font:bold 35px Arial, Helvetica, sans-serif;"><% = DomainSecondWord %></span>
<br />

2nd UPDATE: OK, I've determined that ASP.Net only will show intellisense and read my code if it is not in the properties area of tags. I am guessing this means ASP.Net wants/forces me to make an HTML control a server control, give it an ID, and set its properties in the code-behind. I must admit, this is a better way to do it...although I'm not sure I like being forced to do it. I can still use the percent brackets in I believe all other places in the ASPX page. Anyway, this seems to be how it works, if anyone can confirm or deny please let us know.