code_junkie

How do you specify your Content Type in ASP.NET?

Nov 11th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Response.Clear()
  2. Response.ContentType = "application/xhtml+xm"
  3.  
  4. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
  5. Inherits="_Default" %>
  6.  
  7.  
  8. <asp:literal runat="server" id="dt"></asp:literal>
  9.  
  10.  
  11. <html xmlns="http://www.w3.org/1999/xhtml">
  12. <head runat="server">
  13.  
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. this.dt.Text= "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
  17. Transitional//EN"
  18. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
  19.  
  20. }
Add Comment
Please, Sign In to add comment