MatTrfDet.Controls.Add(New LiteralControl("<tr>"))
        MatTrfDet.Controls.Add(New LiteralControl("<td width=6% class=FormSmlFieldLbl align='center'>"))
        MatTrfDet.Controls.Add(New LiteralControl("国家"))
        MatTrfDet.Controls.Add(New LiteralControl("</td>"))

        MatTrfDet.Controls.Add(New LiteralControl("<td width=6% class=FormSmlFieldLbl align='center'>"))
        MatTrfDet.Controls.Add(New LiteralControl(" 城市"))
        MatTrfDet.Controls.Add(New LiteralControl("</td>"))
        MatTrfDet.Controls.Add(New LiteralControl("</tr>"))

        Dim tlist As DropDownList
        Dim lCtr1

        For i = 0 To 3
            MatTrfDet.Controls.Add(New LiteralControl("<tr>"))

            MatTrfDet.Controls.Add(New LiteralControl("<td width=24% class=FormSmlFieldInput align='left'>"))
            tlist = createListBox("trftoloc" + CStr(lCtr1))
            tlist.Items.Insert(0, CStr(i))
            tlist.Items.Insert(0, CStr(i + 10))
            MatTrfDet.Controls.Add(tlist)
            MatTrfDet.Controls.Add(New LiteralControl("</td>"))


            MatTrfDet.Controls.Add(New LiteralControl("<td width=5% class=FormSmlFieldInput align='left'>"))
            tlist = createListBox("Type" + CStr(lCtr1))
            tlist.Items.Insert(0, CStr(i))
            tlist.Items.Insert(0, CStr(i + 100))
            MatTrfDet.Controls.Add(tlist)
            MatTrfDet.Controls.Add(New LiteralControl("</td>"))


            MatTrfDet.Controls.Add(New LiteralControl("</tr>"))

        Next
        MatTrfDet.Controls.Add(New LiteralControl("</table>"))

        Return ""
    End Function
    Function createListBox(ByVal ctrlid)
        Dim tlist As New DropDownList
        tlist.AutoPostBack = True
        tlist.ID = ctrlid
        tlist.Width = Unit.Percentage(50)
        tlist.EnableViewState = True
        tlist.CssClass = "FormSmlFieldInput"
        createListBox = tlist
    End Function
相关推荐
最新评论 (1)
xshf12345 6月前
1
vb不太清楚,c#的话,一般在page_load里面加上这句话的

if(!Page.IsPostBack)
{

}
返回
发表文章
liu58999
文章数
7
评论数
0
注册排名
334482