<%...@ Page Language="C#" MasterPageFile="~/Member/MasterPage.master" AutoEventWireup="true" CodeFile="ProductMana.ASPx.cs" Inherits="Member_ProductMana" Title="ChinaPackNet - Product Manage" %>
<ASP:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/Javascript">...
function XMLPost2(obj)
...{
var requestUrl = "?parentid=" + obj.value;
var reval = "";
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
XMLHttp.open("POST", requestUrl, false);
XMLHttp.send("");
reval = XMLHttp.responseText;
if(reval != "")
...{
document.getElementById("ctl00_ContentPlaceHolder1_lbCCategory").length=0;
var piArray = reval.split(",");
for(var i=0;i<piArray.length;i++)
其中:lbCCategory的客戶端ID是通過浏覽頁面查看源文件找出來的
可以通過ClIEntScriptManager對象在CS代碼中注冊客戶端代碼獲取控件在客戶端的ID
做浏覽器兼容的話修改JS
var XMLHttp;
if(navigator.userAgent.indexOf("MSIE")>0)
{
xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
}
else
{
xmlHttp = new XMLHttpRequest();
}