code behind

W

wei

Hi folks: i tried to rewrite the following code with code behind. i moved
the c# piece to Page_Load method. but i always got the user's name attached
at the top of the page. it was supposed to be at the bottom of the page. how
can i do?

thank you very much!

<%@ Page Language="C#" %>
<html>
<body>
<h1>Welcome to CorpNet!</h1>
<hr>
Welcome to the corporate intranet! We don't have a lot to offer
right now, but check back in a few days and we'll have information
regarding the massive layoff that has been the subject of so many
rumors. Do remember, though, that we're watching you all the time.
We even know who you are because you had to provide a user name
and password to see this page. To prove it, your user name is
shown below.<br>
<h3>
<%
if (User.Identity.IsAuthenticated)
Response.Write (User.Identity.Name);
%>
</h3>
</body>
</html>
 
C

Carl Prothman [MVP]

Wei,
Don't use Response.Write. Add a Label control
and set it's Text property in the code-behind page.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top