📄 html_image.aspx
字号:
<%@Page Language="C#"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="JScript">
<!--
function ShowHTMLContent() {
var strURL = 'http://<% = Request.ServerVariables["SERVER_NAME"] %><% = Request.Path %>?<% = Request.QueryString %>';
var strDisplay = new String;
var objHTTP = new ActiveXObject("microsoft.XMLHTTP")
objHTTP.open('GET', strURL, false);
objHTTP.send();
var strReply = objHTTP.responseText;
var intStart = strReply.indexOf('<!' + '--start-->') + 12;
var intEnd = strReply.indexOf('<!' + '--end-->');
if ((intStart > 0) && (intEnd > intStart))
var strDisplay = strReply.substring(intStart, intEnd);
document.all['outHTML'].innerText = strDisplay + ' ';
}
function SetCheck(strCheckboxName) {
document.all[strCheckboxName].checked = true;
}
//-->
</script>
<!-- #include file="style.inc" -->
</head>
<body bgcolor="#ffffff" onload="ShowHTMLContent()">
<!--------------------------------------------------------------------------->
<span class="heading">HtmlImage Control</span>
<!--start-->
<img id="MyControl" src="BookmarkButton.gif" runat="server" />
<!--end-->
<p /><div id="outError" runat="server" /><p />
<font face="Courier New" size="2"><div style="background-color:gainsboro; padding-left:10px" id="outHTML">Fetching HTML content...</div></font>
<form runat="server" method="get">
<table border="0">
<tr>
<td nowrap="nowrap"><input type="checkbox" id="chkAlign" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Align =</td><td nowrap="nowrap"><select id="selAlign" size="1" runat="server" onchange="SetCheck('chkAlign')">
<option></option><option>AbsBottom</option><option>AbsMiddle</option><option>Baseline</option><option>Bottom</option><option>Left</option>
<option>Middle</option><option>Right</option><option>TextTop</option><option>Top</option></select></td>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"><input type="checkbox" id="chkAlt" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Alt =</td><td nowrap="nowrap"><input type="text" size="20" id="txtAlt" runat="server" onkeypress="SetCheck('chkAlt')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkBorder" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Border =</td><td nowrap="nowrap"><input type="text" size="3" id="txtBorder" runat="server" onkeypress="SetCheck('chkBorder')" />px</td><td></td>
<td nowrap="nowrap"><input type="checkbox" id="chkDisabled" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Disabled =</td><td nowrap="nowrap"><select id="selDisabled" size="1" runat="server" onchange="SetCheck('chkDisabled')"><option>True</option><option>False</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkHeight" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Height =</td><td nowrap="nowrap"><input type="text" size="3" id="txtHeight" runat="server" onkeypress="SetCheck('chkHeight')" />px</td><td></td>
<td nowrap="nowrap"></td><td align="right" nowrap="nowrap">ID =</td><td nowrap="nowrap"><% = MyControl.ID %></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkSrc" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Src =</td><td nowrap="nowrap"><select id="selSrc" size="1" runat="server" onchange="SetCheck('chkSrc')">
<option>BookmarkButton.gif</option><option>BrickButton.gif</option><option>ClickmeButton.gif</option><option>PlayButton.gif</option><option>PauseButton.gif</option><option>RecordButton.gif</option><option>SpeckledButton.gif</option><option>StopButton.gif</option></select></td><td></td>
<td nowrap="nowrap"></td><td align="right" nowrap="nowrap">TagName =</td><td nowrap="nowrap"><% = MyControl.TagName %></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkVisible" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Visible =</td><td nowrap="nowrap"><select id="selVisible" size="1" runat="server" onchange="SetCheck('chkVisible')"><option>True</option><option>False</option></select></td><td></td>
<td nowrap="nowrap"><input type="checkbox" id="chkWidth" runat="server" /> Set: </td><td align="right" nowrap="nowrap">Width =</td><td nowrap="nowrap"><input type="text" size="3" id="txtWidth" runat="server" onkeypress="SetCheck('chkWidth')" />px</td>
</tr><tr>
<td></td><td></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"></td><td nowrap="nowrap"><input type="submit" Value="Update" runat="server" /></td>
</tr>
</table>
</form>
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e)
{
outError.InnerHtml = "";
try
{
if (IsPostBack)
{
if (chkAlign.Checked) MyControl.Align = selAlign.Value;
if (chkAlt.Checked) MyControl.Alt = txtAlt.Value;
if (chkBorder.Checked) MyControl.Border = Convert.ToInt32(txtBorder.Value);
if (chkDisabled.Checked) MyControl.Disabled = Convert.ToBoolean(selDisabled.Value);
if (chkHeight.Checked) MyControl.Height = Convert.ToInt32(txtHeight.Value);
if (chkSrc.Checked) MyControl.Src = selSrc.Value;
if (chkVisible.Checked) MyControl.Visible = Convert.ToBoolean(selVisible.Value);
if (chkWidth.Checked) MyControl.Width = Convert.ToInt32(txtWidth.Value);
}
selAlign.Value = MyControl.Align.ToString();
txtAlt.Value = MyControl.Alt;
txtBorder.Value = MyControl.Border.ToString();
selDisabled.Value = MyControl.Disabled.ToString();
txtHeight.Value = MyControl.Height.ToString();
selSrc.Value = MyControl.Src.ToString();
selVisible.Value = MyControl.Visible.ToString();
txtWidth.Value = MyControl.Width.ToString();
}
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 + -