Posted on: 11/17/2012 12:48:31 AM | Views : 434

Is there a way to define a namespace for a user control? I tried the following:
Namespace MyNamespace

  Partial Class MyUserControl
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

      lnkProducts.NavigateUrl = "~/Products/List.aspx"

    End Sub
  End Class

End Namespace
But VS2010 gives me the following error on lnkProducts: "'lnkProducts' is not declared. It may be inaccessible due to its protection level."
I'd like to be able to refer to the user control in the code behind of another page as MyNamespace.MyUserControl. Is there a way to do this?
...

Go to the complete details ...