华域联盟 .Net asp.net直接Response输出WML页面示例代码

asp.net直接Response输出WML页面示例代码

复制代码 代码如下:

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();

}
您可能感兴趣的文章:

  • asp.net下Response.ContentType类型汇总
  • asp.net 页面转向 Response.Redirect, Server.Transfer, Server.Execute的区别
  • asp.net 使用Response.Filter 过滤非法词汇
  • asp.net中Response.Redirect与Server.Transfer的区别分析
  • ASP.NET笔记之 Request 、Response 与Server的使用
  • ASP.NET之Response.Cookies.Remove 无法删除COOKIE的原因
  • asp.net中WebResponse 跨域访问实例代码
  • Asp.net response对象与request对象使用介绍
  • Asp.net中Response.Charset与Response.ContentEncoding区别示例分析
  • asp.net内置对象 Response对象使用介绍

本文由 华域联盟 原创撰写:华域联盟 » asp.net直接Response输出WML页面示例代码

转载请保留出处和原文链接:https://www.cnhackhy.com/51843.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部