📄 asp_xml.aspx
字号:
<%@Page Language="C#"%>
<%@Import Namespace="System.Drawing" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="JScript">
<!--
function SetCheck(strCheckboxName) {
document.all[strCheckboxName].checked = true;
}
//-->
</script>
<!-- #include file="style.inc" -->
</head>
<body bgcolor="#ffffff">
<!--------------------------------------------------------------------------->
<span class="heading">ASP:Xml Control</span><p />
<!--start-->
<ASP:Xml id="MyControl" DocumentSource="xml/books.xml" runat="server" />
<!--end-->
<p />
<div id="outError" runat="server" />
<form runat="server" method="get">
<table border="0">
<tr><td nowrap="nowrap"></td><td align="right" nowrap="nowrap">DocumentSource =</td><td nowrap="nowrap"><a href="<% = MyControl.DocumentSource %>" target="_blank"><% = MyControl.DocumentSource %></a></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"></td><td align="right" nowrap="nowrap">ID =</td><td nowrap="nowrap"><% = MyControl.ID %></td><td nowrap="nowrap"></td></tr>
<tr><td nowrap="nowrap"><input type="checkbox" id="chkTransformSource" runat="server" /> Set: </td><td align="right" nowrap="nowrap">TransformSource =</td><td nowrap="nowrap"><select id="selTransformSource" size="1" runat="server" onchange="SetCheck('chkTransformSource')">
<option>{not set}</option><option>listview.xsl</option><option>tableview.xsl</option><option>reportview.xsl</option></select></td><td nowrap="nowrap"></td><td></td><td></td>
<td nowrap="nowrap"><input type="button" Value="Reset" onclick="javascript:location.href='http://<% = Request.ServerVariables["SERVER_NAME"] %><% = Request.Path %>'"></td><td nowrap="nowrap"><input type="submit" Value="Update" runat="server" /></td></tr>
</table>
</form>
<script language="C#" runat="server">
void Page_Load(Object source, EventArgs e)
{
outError.InnerHtml = "";
try
{
if (IsPostBack)
{
if (chkTransformSource.Checked && selTransformSource.Value.Substring(1, 1) != "{")
MyControl.TransformSource = "xml/" + selTransformSource.Value;
}
string strXslFileName = MyControl.TransformSource;
strXslFileName = strXslFileName.Substring(strXslFileName.LastIndexOf("/") + 1);
selTransformSource.Value = strXslFileName;
}
catch (Exception objError)
{
outError.InnerHtml = "<b>* Error</b>: " + objError.Message + "<p />";
}
}
</script>
<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -