Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何读取在ajax选项卡容器上动态添加到gridview中的文本框值_Ajax_Vb.net_Gridview - Fatal编程技术网

如何读取在ajax选项卡容器上动态添加到gridview中的文本框值

如何读取在ajax选项卡容器上动态添加到gridview中的文本框值,ajax,vb.net,gridview,Ajax,Vb.net,Gridview,从动态添加到AjaxTabContainer的TabPanel内的gridview中的文本框中读取值,我面临着困难 注意,所有控件都是根据用户选项动态添加的 顺序如下: Design Time: One Panel and other user options (date & some other fields) Run Time: - Add AjaxTab container & Tab Panel which is vary upon user filter (Tab create

从动态添加到AjaxTabContainer的TabPanel内的gridview中的文本框中读取值,我面临着困难

注意,所有控件都是根据用户选项动态添加的

顺序如下:

  
Design Time:
One Panel and other user options (date & some other fields)

Run Time:
- Add AjaxTab container & Tab Panel which is vary upon user filter (Tab created based on db -records)
- Inside each tab, added the GridView with dataset
- Add some textbox into each of GridView Line
第页: 我可以使用gridview和文本框(*如下)成功显示选项卡控件 现在,当用户单击“更新”按钮时,如何读取每个文本框中的值? 我尝试使用FindControl,但什么都没有

我的代码:-


Private Sub DynamicTabGVLoad(ByVal seqno As String)
        createTab()
        ds = allotmentdb.getRoomType()
        For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
            Dim tabcontent As New Control()
            Dim tbldynamic As New Table()
            Dim tbrdynamic As New TableRow()
            Dim tbcdynamic As New TableCell()           
            Dim roomtypekey As String
            roomtypekey = ds.Tables(0).Rows(i)("roomtypekey").ToString()
            Dim gv_alines As New GridView
            gv_alines.AutoGenerateColumns = True
            gv_alines.Attributes.Add("runat", "server")
            Dim ds1 As New Data.DataSet()
            ds1 = allotmentdb.getAllotmentLinesTabGV(roomtypekey, seqno, System.DateTime.Now.ToString(("yyyy-MM-dd")))
            gv_alines.EmptyDataText = "No Record Found!"
            'gv_alines.ShowHeaderWhenEmpty = True
            gv_alines.DataSource = ds1
            gv_alines.DataBind()
            If gv_alines.Rows.Count > 0 Then
                gv_alines.HeaderRow.Cells(0).Visible = False
                gv_alines.HeaderRow.Cells(1).Visible = False
                gv_alines.HeaderRow.Cells(4).Visible = False
                For Each gvr As GridViewRow In gv_alines.Rows
                    gvr.Cells(0).Visible = False
                    gvr.Cells(1).Visible = False
                    gvr.Cells(4).Visible = False
                    Dim txtInternetRoom As New TextBox()
                    txtInternetRoom.ID = "txtInternetRoom"
                    txtInternetRoom.Text = gvr.Cells(5).Text
                    txtInternetRoom.Style.Add("text-align", "right")
                    txtInternetRoom.Width = 100
                    gvr.Cells(5).Controls.Add(txtInternetRoom)
                    Dim txtInternetRate As New TextBox()
                    txtInternetRate.ID = "txtInternetRate"
                    txtInternetRate.Text = FormatNumber(gvr.Cells(6).Text, 2)
                    If txtInternetRate.Text = "0.00" Then txtInternetRate.Text = "NA"
                    txtInternetRate.Style.Add("text-align", "right")
                    txtInternetRate.Width = 100
                    gvr.Cells(6).Controls.Add(txtInternetRate)
                    Dim txtInternetRate2 As New TextBox()
                    txtInternetRate2.ID = "txtInternetRate2"
                    txtInternetRate2.Text = FormatNumber(gvr.Cells(7).Text)
                    If txtInternetRate2.Text = "0.00" Then txtInternetRate2.Text = "NA"
                    txtInternetRate2.Style.Add("text-align", "right")
                    txtInternetRate2.Width = 100
                    gvr.Cells(7).Controls.Add(txtInternetRate2)
                    Dim txtInternetRate3 As New TextBox()
                    txtInternetRate3.ID = "txtInternetRate3"
                    txtInternetRate3.Text = FormatNumber(gvr.Cells(8).Text)
                    If txtInternetRate3.Text = "0.00" Then txtInternetRate3.Text = "NA"
                    txtInternetRate3.Style.Add("text-align", "right")
                    txtInternetRate3.Width = 100
                    gvr.Cells(8).Controls.Add(txtInternetRate3)
                    Dim txtInternetRate4 As New TextBox()
                    txtInternetRate4.ID = "txtInternetRate4"
                    txtInternetRate4.Text = FormatNumber(gvr.Cells(9).Text)
                    If txtInternetRate4.Text = "0.00" Then txtInternetRate4.Text = "NA"
                    txtInternetRate4.Style.Add("text-align", "right")
                    txtInternetRate4.Width = 100
                    gvr.Cells(9).Controls.Add(txtInternetRate4)
                Next
            Else               
            End If
            tbcdynamic.Controls.Add(gv_alines)
            tbrdynamic.Cells.Add(tbcdynamic)
            tbldynamic.Rows.Add(tbrdynamic)
            tabcontent.Controls.Add(tbldynamic)
            ajxTab.Tabs(i).Controls.Add(tabcontent)
        Next
        pnlDynamic.Controls.Add(ajxTab)
    End Sub
    Private Sub createTab()
        ds = allotmentdb.getRoomType()
        ajxTab = New AjaxControlToolkit.TabContainer()
        ajxTab.Attributes.Add("runat", "server")
        'Me.Controls.Add(ajxTab)
        For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
            Dim tbpnlDynamic As New TabPanel()
            tbpnlDynamic.Attributes.Add("runat", "server")
            tbpnlDynamic.HeaderText = ds.Tables(0).Rows(i)("RoomType").ToString()
            tbpnlDynamic.ID = ds.Tables(0).Rows(i)("RoomTypeKey").ToString()
            tbpnlDynamic.Visible = True
            ajxTab.Tabs.Add(tbpnlDynamic)
            ajxTab.ActiveTabIndex = 0
        Next
    End Sub
我急需它。提前谢谢