I have a form the has some textbox controls. I have a script to request these control values to update a table in my database. The problem I am having is that I added the textbox controls to inside the TabContainer and now the request does not see any values. Below is my form and my script code:

<script runat="server">

Sub Change_Customer(ByVal sender As Object, ByVal e As System.EventArgs)

        objConnection = New OleDbConnection(strConnection)
        objConnection.Open()
        
                
        strSQL = "update tblCustomers set Customer_Name='" & Replace(Request("Customer_Name"), "'", "''")
        strSQL += "' where Customer_ID = " & Request("Customer_ID")


        objCommand = New OleDbCommand(strSQL, objConnection)
        objCommand.ExecuteNonQuery()
    
        objCommand = Nothing
        objConnection.Close()
        objConnection = Nothing
        
      End Sub

</script>




<asp:ScriptManager id="ScriptManager1" runat="server" />    
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" >
<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Customer Information" ><ContentTemplate>

<FORM runat="server">
<asp:TextBox class=textbox id=Customer_Name runat="server" MaxLength="65" CssClass="input_text" size="60"></asp:TextBox>
<asp:Button class=submit id=updatebutton onclick=Change_Customer runat="server" tooltip="Click to update" Text="Update"></asp:Button>
</FORM>

</cc1:TabPanel><BR><cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Ship To Addresses"><BR></cc1:TabPanel><BR></cc1:TabContainer>

When the textbox is outside the TabContainer it works fine. In the container the request value is blank. How do I update my table with the value of the textbox in the TabContainer?

I need to know how to find the textbox controls in the AJAX tab container so I can use the value to update the field in the table. Please show a sample code please.

Thanks

Hi Stretcher,

Welcome to DaniWeb.

Use code tags to format your code.

Why do you use Request object to get the value of TextBox control. You can use like TextBox1.Text to get the value of it.

Also you are using <form> tag inside the server controls. Basically the ASP.NET controls should be surrounded by <form> tag.

To get the value of Customer_Name textbox value from Request object, try this

Request("TabContainer1$TabPanel1$Customer_Name")

It worked perfectly, thank you vey much.

Hi Stretcher,

Mark this thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.