Why are you using Me.POSearch? -- may not be the root of the problem but
looks a little weird.
Try this :
Dim mySearch as POSearch
If Not Page.FindControl("POSearch1") Is Nothing Then
mySearch = Ctype(Page.FindControl("POSearch1"), POSearch)
Else
'Control Not found o nthe page
End If
That way you will know where the error is exactly happening
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)
http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...
http://www.swanandmokashi.com/ http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
Hi Everyone,
I'm working on a sollution to one of my problems and have come across this
sample
Dim mySearch as POSearch = ctyap(Page.FindControl(POSearch1),
me.POSearch)
mySearch.Search(str)
"they sugested getting a reference to the user control before setting
properties like visible, one I'm having a issue with"
I have a couple user controls on this masterpage and I'd like to access
them
but the system complains that (in the code above):
Type POSearch is not defined
I don't have a namespace defined for the masterpage or usercontrol
(because
that cased other problems). In case you needed to know that.
How do I expose the Usercontrol as a type so that this could work?
Thanks
Michael