normaly a asp.net page looks like:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Foo.aspx.cs" Inherits="Foos" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="my text"></asp:Label>
</div>
</form>
</body>
</html>
and then i get displayed “my text”.
the problem is, now i need to make a page and just display the “my text” without the html stuff in the background. so when i look in the sourcecode it should just be my text
of course i need the asp.net in the background to change the label text.
is this possible?
Just delete everything except the page tag, and on Page_Load write my text in the response
In the aspx:
In the .cs:
Or you can add a literal to the page (set it’s value in the code behind) and remove the html stuff like this: