<%=%> 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top