如何在页面上动态的生成 WebForm控件

2025-05-11 19:55:57
推荐回答(2个)
回答1:

<% if request("infoid")<>"" then set rs=conn.execute("select * from nproduct where id="&request("infoid")) if not (rs.eof and rs.bof) then proname=rs("proname") content=rs("proinfo") end if rs.close set rs=nothing end if %>
http://www.asp888.net 豆腐技术站
在asp.ne中,我们可以利用程序在编程的时候动态的生成我们需要的WebForms 控件,我们先看看下面的例子








Height="200px"
Width="300px">







由此我们可以看出,我们可以 在程序的 具体运行设定的时候给出不同的控件,重要的是这些空间都是动态生成的;
下面,我给大家 给出 一些 我们常用的 WebForms 控件:
AdRotator,Button,Calendar,CheckBox,DataGrid,DataList,DropDownList,HyperLink,Image,ImageButton
Label,Panel,RadioButton,Repeater,Table,TextBox
这些控件的含义通过他们的名称我们就可以很容易的看出来,所以 我就不在这里详细讲解他们的含义了,如果

回答2:

通过 js 代码可以进行动态生成