locked
Strange problem in Custom Control!! RRS feed

  • Question

  • User606128555 posted

    Hi guys!

    someone here can tell me what's the relation between the name of a namespace and a class in a server control!!!

    open vs2008 and create a default server control which name of the namespace and name of the class is the same.

    compile the control, add a webapplication project, and add the control to a grid view.

    edit bindings and bind the default Text property, ok, now run the web application, you will get a compile error!!

    now just change the class name in the server control and update the source of the page, run it again, no error occurs!!!

    I havn't seen this error before, cause always my namespace names and class names are differs :-?

     

    Sunday, June 1, 2008 8:30 AM

All replies

  • User-667042492 posted

    hi,

    i think the answer of your quertion is below..

    http://msdn.microsoft.com/en-us/library/aa691136(VS.71).aspx

    i hope this help you..

    Sunday, June 1, 2008 1:06 PM
  • User606128555 posted

    Thanks for the reply,

    unfortunately it wasn't the answer, because :

    • first scenario :

    if N=I and I'm calling N.I/I inside I, the compiler doesn't know N/I is a referment to N/I or is a referment to I/N and a type identifier "I" or "N" inside that.

    • second scenario :

    if N=I and I'm calling N.I outside the N so it's always : N=namespace and I=type identifier.

    creating an instance of the control inside asp.net page and calling it, classifies in the second scenario.

    Monday, June 2, 2008 1:44 AM