Avatar of tfewster500
tfewster500 asked on

Passing Control Value from Control in Tab Container to ObjectDataSource

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?

.NET Programming

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy