一个cms系统中一个asp文件,里面有这样一句:<!--#include file = language.asp -->我看了language.asp的内容,只有一句
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">我想用asp.net这个asp文件,我该怎样实现类似
<!--#include file = language.asp -->
的功能?
我想写一个类,类中有一个language_gb2312()函数,如下:public static string language_gb2312()
        {
            System.Web.HttpContext.Current.Response.Write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"> ");        }
在我的asp.net页面中的pageload函数中调用language_gb2312(),请问这个方法能实现类似功能吗?

解决方案 »

  1.   

    同样,aspx中同样 可以使用include指令:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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>
        <!--#include file ="lang.aspx" --> 
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        </form>
    </body>
    </html><meta http-equiv="Content-Type" content="text/html; charset=gb2312">