两种方法接口aspx页面的编写(页面展示xml文档)
第一种方法:
实例:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XMLQunar.aspx.cs" Inherits="Byecity2009.Visa.WebApp.XMLQunar" ContentType="text/xml"%>
<%@ Import Namespace="Byecity2009.Visa.Web" %>
<%@ OutputCache VaryByParam="none" Duration="1800" %><?xml version="1.0" encoding="utf-8"?>
<VisaList><asp:Repeater ID="rpAllVisa" runat="server" DataSource="<%# AllVisaViewTable %>"><ItemTemplate>
<Item Price='<%# ShowPrice_Only(Eval("VisaXml").ToString(),"GuestPrice","CuXiaoPrice") %>' Country='<%# Eval("CountryC_Name") %>' Type='<%# Eval("VisaTypeName") %>' DealCity='<%#Eval("VisaTypeName").ToString().Contains("广州")?"广州":Eval("VisaTypeName").ToString().Contains("上海")?"上海":"北京"%>' ValidityDate='<%# SelectSingleNodeText(Eval("VisaXml").ToString(),"ValidityDate") %>' SettleDay='<%# SelectSingleNodeText(Eval("VisaXml").ToString(),"SettleDay") %>' IntendingDay='<%# SelectSingleNodeText(Eval("VisaXml").ToString(),"IntendingDay") %>' IsExam='<%# SelectSingleNodeText(Eval("VisaXml").ToString(),"IsExam") %>' VisaRequest='<%# BuildVisaRequest( Eval("VisaXml").ToString() ) %>' letter="" Category="<%# GetCategoryStr(Eval("BasicTypeName").ToString()) %>">
<Confine><%# SelectSingleNodeText(Eval("VisaXml").ToString(),"Confine") %></Confine>
<Url><%# string.Format( "http://visa.byecity.com/visa-{0}-{1}.html", Eval( "CountryE_Name" ).ToString().ToLower().Replace(" ","_"), Eval( "TypeID" ) )%></Url>
</Item></ItemTemplate>
</asp:Repeater>
</VisaList>
第二种方法:
实例:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LineDetail.aspx.cs" Inherits="WebInterFace.Group.LineDetail" ContentType="text/xml" %>
<%=sbContent %>
CreateContect();
function CreateContect(){
DataSet list = bll.GetGroupInfoListForInterFace(strwhere, " ");
if (list != null && list.Tables[0].Rows.Count > 0)
{
XmlNode node = xml.CreateNode(XmlNodeType.XmlDeclaration, "", "");
node.InnerText += " encoding=\"utf-8\"";
xml.AppendChild(node);
XmlNode dujiasnode = xml.CreateElement("dujia_xianlus");
for (int i = 0; i < list.Tables[0].Rows.Count; i++)
{
string GropID = string.Empty;
LineID = list.Tables[0].Rows[i]["ID"].ToString();
Byecity2011.WebSite.Model.Prod_ProductGroup group = bll.GetGroupProductDetailByID(Convert.ToInt32(LineID));
XmlNode dujianode = xml.CreateElement("dujia_xianlu");
XmlNode TypeNode = xml.CreateElement("type");
TypeNode.InnerText = "1";
XmlNode rangetypeNode = xml.CreateElement("rangetype");
rangetypeNode.InnerText = "2";
XmlNode traffictypeNode = xml.CreateElement("traffictype");
traffictypeNode.InnerText = "11";
XmlNode LinkNode = xml.CreateElement("link");
LinkNode.InnerText = path + "Line-" + LineID + ".html";
XmlNode CodeNode = xml.CreateElement("code");
CodeNode.InnerText = LineID;
dujianode.AppendChild(TypeNode);
dujianode.AppendChild(rangetypeNode);
dujianode.AppendChild(traffictypeNode);
&n
补充:Web开发 , ASP.Net ,