Include a c# file in aspx page

Posted by BeraCim on Stack Overflow See other posts from Stack Overflow or by BeraCim
Published on 2010-04-09T04:30:41Z Indexed on 2010/04/09 4:33 UTC
Read the original article Hit count: 428

Filed under:
|

Hi all:

I have an aspx page that has a @Page directive which points to a c# class. e.g.

<@ Page Language="C#" EnableSessionState="true" ValidateRequest="False" Inherits="MyClass" %>

MyClass extends Page, which is the code behind class for that aspx page.

Now I want to add another class to the aspx page. This class does some processing and will redirect the user to another page if certain conditions are met. It will be called before the above directive. I tried adding another @Page directive, but gotten an unknown error (literally). I'm thinking that there can only be one code behind class per aspx page so I got the error when I added another one. Googling such question didnt really help me with the answer.

So, how do I add another c# class to the same aspx page?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#