📄 default.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function FillData(strcity)
{
document.getElementById("DropDownList1").options.length=0;
var indexofcity;
var city;
//切割传递来的字符串
while(strcity.length>0)
{
//判断是否是最后一个字符串
indexofcity=strcity.indexOf(",");
if(indexofcity >0)
{
city=strcity.substring(0,indexofcity);
strcity=strcity.substring(indexofcity+1);
//填充下拉框
document.getElementById("DropDownList1").add(new Option(city,city));
}
else
{
// 如果是最后一个字符串
document.getElementById("DropDownList1").add(new Option(strcity,strcity));
break;
}
};
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width: 593px">
<tr>
<td colspan="2" style="font-weight: bold; color: #3300ff; text-align: center">
使用脚本方法实现局部刷新</td>
</tr>
<tr>
<td>
填写城市
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>
</td>
<td>
<input id="Button1" style="width: 142px" type="button" value="查询" onclick="seekCity()" /></td>
</tr>
<tr>
<td>
选择城市里的区域</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="154px">
</asp:DropDownList></td>
</tr>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -