Static Methods!!!

  • Thread starter Thread starter Adam J Knight
  • Start date Start date
A

Adam J Knight

Hi all.

I have created an assembly that contains a helper class (myTestClass)

I have created a reference to this Assembly in vs2003. and included a 'using
MyNameSpace;' entry in my code behind.

Problem: I can't seem to access the static methods of this class:

I am trying to use these methods like so:
<asp:DropDowList ID="Test" DataSource="<%# myTestClass.HelperMethod() %>"
Runat="server"/>

Error: The name 'myTestClass' does not exist in the current context

What am i missing???

Cheers,
Adam
 
Hi
Use Import Directive :
<%@ Import Namespace="MyNameSpace" %>

let me know if it is useful for you
A.Hadi
 
Your missing the intellisence provided by the ide. Your missing this is
aspnet group post to another group this is ASP code <%#
myTestClass.HelperMethod() %> Its outdated, obsolete, and for backwards
compatibility only.

You can set your control datasource in the page_init event and the ide would
tell you more about your error at design time and not bother us with your
backwards compatibility no intellisence compiles but does not run ASP
development techniques.

DWS
 
Back
Top