<%=%> in asp.net

  • Thread starter Thread starter Guoqi zheng
  • Start date Start date
G

Guoqi zheng

Dear sir,

In .asp, we can do the following.
<%
strWhatever = "here is some strings"
%>

<html><body>
<%=strWhatever%>
</body></html>

We can use <%=%> to write some html code, how can I do the same in ASP.NET?

Thanks in advanced.

Guoqi Zheng
http://www.meetholland.com
 
You can do it the pretty much same way, but the newer, more object oriented
..NET way would be to use a label control. Then in your code behind page you
use code like this:
Label1.Text = "here is some strings"
 
Though the use of such tags should be limited, as there are usually better "asp.net" ways to accomplish these things.
 
Back
Top