asp.net如何动态加载web用户控件
<%@PageLanguage="C#"MasterPageFile="~/MasterPage1.master"AutoEventWireup="true"CodeFi...
<%@ Page Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="GoodClass.aspx.cs" Inherits="GoodClass" Title="无标题页" %>
<%@ Register Src="ptxjSearchBar.ascx" TagName="ptxjSearchBar" TagPrefix="uc3" %>
<asp:Content ID="GoodsClass" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="ContentNav" id="ContentNav" style=" width: 715px; height: 21px;"><span>当前的位置</span> <img alt="" src="Images/背景图片/sign.gif" width="13" height="13" /><asp:Label ID="CategoryName" Text="" runat="server"></asp:Label></div>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="width: 683px">
<tr>
<td colspan="4" style="width: 105px; height: 123px;">
<div id="GoodPropertySelection" style=" margin:5px auto"; >
<%--<uc3:ptxjSearchBar ID="ptxjSearchBar" runat="server"/>--%>
</div>
<script>var obj=window.document.getElementById("GoodPropertySelection");
obj.innerHTML="<uc3:ptxjSearchBar ID='ptxjSearchBar' runat='server'/>";
</script>
</td>
</tr>
<tr>......
动态加载web用户控件时老是加载不进去, <div id="GoodPropertySelection" ...那里老是留空 展开
<%@ Register Src="ptxjSearchBar.ascx" TagName="ptxjSearchBar" TagPrefix="uc3" %>
<asp:Content ID="GoodsClass" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="ContentNav" id="ContentNav" style=" width: 715px; height: 21px;"><span>当前的位置</span> <img alt="" src="Images/背景图片/sign.gif" width="13" height="13" /><asp:Label ID="CategoryName" Text="" runat="server"></asp:Label></div>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="width: 683px">
<tr>
<td colspan="4" style="width: 105px; height: 123px;">
<div id="GoodPropertySelection" style=" margin:5px auto"; >
<%--<uc3:ptxjSearchBar ID="ptxjSearchBar" runat="server"/>--%>
</div>
<script>var obj=window.document.getElementById("GoodPropertySelection");
obj.innerHTML="<uc3:ptxjSearchBar ID='ptxjSearchBar' runat='server'/>";
</script>
</td>
</tr>
<tr>......
动态加载web用户控件时老是加载不进去, <div id="GoodPropertySelection" ...那里老是留空 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询