troubleshooting Question

Passing Control Value from Control in Tab Container to ObjectDataSource

Avatar of tfewster500
tfewster500 asked on
.NET Programming
1 Comment1 Solution632 ViewsLast Modified:
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?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros