Advertisement

05.24.2008 at 08:56AM PDT, ID: 23429891
[x]
Attachment Details

Passing Control Value from Control in Tab Container to ObjectDataSource

Asked by tfewster500 in Visual Studio .NET 2005

Tags: ASP.NET 2.0, VB.NET, IE 7.0

Using VB.NET, VS2005, ASP.NET 2.0 and Ajax Control Toolkit.

I have a GridView connected to an ObjectDataSource.  The SelectMethod on my ObjectDataSource is expecting a parameter "First_Name" and I want to pass this value from a TextBox (txtFirst_Name) on my form.  The difficulty is that the TextBox is within an ajaxToolkit TabContainer control.

When I go through the SmartTags - Configure Datasource wizard, I identify the Parameter, choose control as the source and the wizard actually shows me "txtFirst_Name" as one of the available controls so I select it.  When I run my application, I get an error that it cannot find "txtFirst_Name".  This makes sense to me as the control is within the panel on the Tab Container.

So, I go back and change the control to "CType(tab.FindControl("txtFirst_Name"), TextBox).Text.Trim".  I know this code works in my code-behind as I use it elsewhere.  Problem is the ObjectDataSource still cannot find the control.

How do I pass in the value to the ObjectDataSource?

Start Free Trial
[+][-]05.24.2008 at 09:06PM PDT, ID: 21641433

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Studio .NET 2005
Tags: ASP.NET 2.0, VB.NET, IE 7.0
Sign Up Now!
Solution Provided By: jmarbutt
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628