For me, this only generates the actual text in response.write (); expression. I am downloading the complete code for clarity.
Visual Studio: 2010
Code for:
public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Write("I CAN ONLY SEE THIS NO OTHER HTML TAG IS INCLUDED"); Response.End(); } }
HTML code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> <!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> </div> </form> </body> </html>
EXIT and HTML Source:
I CAN ONLY WATCH IT TO DO NOT INCLUDE ANOTHER HTML TAG
I get the desired result. I tried this code with a master page and got the same result.
Please make sure your AutoEventWireup = "true" if I return this value and then change the SOURCE HTML to this
<!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><title> </title></head> <body> <form method="post" action="Default2.aspx" id="form1"> <div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE2MTY2ODcyMjlkZGivF0fgbeE6VebNR51MYSu3yJdsZ9DwEtIPDBVRf4Vy" /> </div> <div> </div> </form> </body> </html>
source share