asp.net直接Response输出WML页面示例代码
程序员文章站
2024-02-28 16:19:04
复制代码 代码如下: protected void page_load(object sender, eventargs e) { response.contenttype...
复制代码 代码如下:
protected void page_load(object sender, eventargs e)
{
response.contenttype = "text/vnd.wap.wml";
stringbuilder builder = new stringbuilder();
builder.appendline("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
builder.appendline("<!doctype wml public \"-//wapforum//dtd wml 1.2//en\" \"http://www.wapforum.org/dtd/wml12.dtd\">");
builder.appendline("<wml>");
builder.appendline("<head>");
builder.appendline("<meta http-equiv=\"cache-control\" content=\"max-age=0\" />");
builder.appendline("</head>");
builder.appendline("<card title=\"公开信息查阅中心\">");
builder.appendline("<p><img src=\"images/logo.png\" alt=\"公开信息查阅中心\" /><br/>");
builder.appendline("<a href=\"\" title=\"新闻动态\">新闻动态</a>|<a href=\"department.aspx\" title=\"部门机构\">部门机构</a><br/>");
builder.appendline("<a href=\"\" title=\"档案文件\">档案文件</a>|<a href=\"\" title=\"最新文件\">最新文件</a><br/>");
builder.appendline("");
builder.appendline(" </p></card>");
builder.appendline("</wml>");
response.write(builder.tostring());
response.end();
}