Eden
Eden

Reputation: 543

access static class from asp.net form

I am using <%# MyFormatClass(Eval("fieldname")) %> to display data in a grid view on my page. MyFormatClass works fine, but now I want to move it to a central location that can be used by many pages. When I try to access the class <%# Utils.MyFormatClass(Eval("fieldname")) %> it no longer works. Is this something we are allowed to do?

Upvotes: 0

Views: 391

Answers (1)

Paolo Tedesco
Paolo Tedesco

Reputation: 57202

As you don't provide much information this is just a guess, but maybe you need simply to put your Utils class in your App_Code folder; all the code there will be compiled to an assembly that is available to all your pages.

Upvotes: 1

Related Questions