遍历获取ASP.NET页面控件的名称及值
protected void Page_Load(object sender, EventArgs e)
{
getAllControlValue(this);
}
Hashtable getAllControlValue( object PageOrUserControl )
{
Hashtable rtn = new Hashtable();
foreach (Control ctr in (PageOrUserControl as Page).Controls)
{
getControlValue(ctr, rtn);
}
return rtn;
}
void getControlValue(Control ctrIn,Hashtable ht)
{
foreach (Control ctr in ctrIn.Controls)
{
Type controlType = ctr.GetType();
switch (controlType.ToString())
{
case "System.Web.UI.WebControls.TextBox":
TextBox controlTextBoxObj = (TextBox)ctr;
string controlTextBoxName = controlTextBoxObj.ID;
 
相关文档:
1:客户端
<table border="0" style="width: 60%">
<tr><td colspan="2" style="height: 5px">
数据库还原和备份:</td></tr>
<tr><td style="width: 171px; height: 23px;">
请选择数据库:</t ......
第一种方法:
通过URL链接地址传递
send.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
Request.Redirect("Default2.aspx?username=honge");
&n ......
一、概述
考虑Html本身不带定时刷新页面的控件,且不考虑使用第三方控件;因此考虑使用Javascript中的setTimeout+xmlhttp来实现定时更新页面中部分内容,此实现在IE6.0及以上版本测试通过,其他浏览器暂时未测试过。
二、功能及特点
1、Javascript通过Microsoft的MSXML对象,动态获取后台数据库数据;
&n ......