如何在asp.net后台代码中获取前台div,其中要获取div的id是在后台通过变量拼接而成的 50
如题,前台代码为:<divid="XS_01"runat="server">测试01</div><divid="XS_02"runat="server">测试02</di...
如题,前台代码为:
<div id = "XS_01" runat="server" >测试01</div>
<div id = "XS_02" runat="server" >测试02</div>
<div id = "XS_03" runat="server" >测试03</div>
<div id = "XS_04" runat="server" >测试04</div>
<div id = "XS_05" runat="server" >测试05</div>
后台代码为:
string HouZhui = "01";
string div = "XS_" + HouZhui;
直接通过"XS_01"可以直接访问该div,但问题是怎样通过这个变量div 获取前台的名称为“XS_01”的div呢? 展开
<div id = "XS_01" runat="server" >测试01</div>
<div id = "XS_02" runat="server" >测试02</div>
<div id = "XS_03" runat="server" >测试03</div>
<div id = "XS_04" runat="server" >测试04</div>
<div id = "XS_05" runat="server" >测试05</div>
后台代码为:
string HouZhui = "01";
string div = "XS_" + HouZhui;
直接通过"XS_01"可以直接访问该div,但问题是怎样通过这个变量div 获取前台的名称为“XS_01”的div呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询