AJAX Tab Control

Thread Solved

Join Date: Oct 2009
Posts: 5
Reputation: Stretcher75 is an unknown quantity at this point 
Solved Threads: 0
Stretcher75 Stretcher75 is offline Offline
Newbie Poster

AJAX Tab Control

 
0
  #1
Oct 25th, 2009
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:


  1. <script runat="server">
  2.  
  3. Sub Change_Customer(ByVal sender As Object, ByVal e As System.EventArgs)
  4.  
  5. objConnection = New OleDbConnection(strConnection)
  6. objConnection.Open()
  7.  
  8.  
  9. strSQL = "update tblCustomers set Customer_Name='" & Replace(Request("Customer_Name"), "'", "''")
  10. strSQL += "' where Customer_ID = " & Request("Customer_ID")
  11.  
  12.  
  13. objCommand = New OleDbCommand(strSQL, objConnection)
  14. objCommand.ExecuteNonQuery()
  15.  
  16. objCommand = Nothing
  17. objConnection.Close()
  18. objConnection = Nothing
  19.  
  20. End Sub
  21.  
  22. </script>
  23.  
  24.  
  25.  
  26.  
  27. <asp:ScriptManager id="ScriptManager1" runat="server" />
  28. <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" >
  29. <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Customer Information" ><ContentTemplate>
  30.  
  31. <FORM runat="server">
  32. <asp:TextBox class=textbox id=Customer_Name runat="server" MaxLength="65" CssClass="input_text" size="60"></asp:TextBox>
  33. <asp:Button class=submit id=updatebutton onclick=Change_Customer runat="server" tooltip="Click to update" Text="Update"></asp:Button>
  34. </FORM>
  35.  
  36. </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
Last edited by peter_budo; Oct 27th, 2009 at 10:46 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 452
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training
 
0
  #2
Oct 26th, 2009
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
  1. Request("TabContainer1$TabPanel1$Customer_Name")
Last edited by Ramesh S; Oct 26th, 2009 at 6:56 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 5
Reputation: Stretcher75 is an unknown quantity at this point 
Solved Threads: 0
Stretcher75 Stretcher75 is offline Offline
Newbie Poster
 
0
  #3
Oct 26th, 2009
It worked perfectly, thank you vey much.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 452
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training
 
0
  #4
Oct 26th, 2009
Hi Stretcher,

Mark this thread as solved.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 687 | Replies: 3
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC