I figured out I can do this:
---file1.ascx
<script runat="server">
public int data;
</script>
---file2.aspx
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register TagPrefix="uc1" TagName="inc" Src="file1.ascx" %>
<uc1:inc id="ascx" runat="server"></uc1:inc>
<script runat="server">
protected void Page_Load( object sender, EventArgs e )
{
ascx.data = 1;
}
</script>
...which is good enough for me.. gets me basic code re-use without
having to worry about session getting reset by pushing DLLs..
On Feb 3, 11:51 am, Cerebrus <[email protected]> wrote:
> I strongly doubt it. In any case, shared code should be in a shared
> location... say, App_Code.
>
> On Feb 3, 8:26 pm, jay <[email protected]> wrote:
>
>
>
> > Is it possible to share code between 2 ASPX files that do not have a
> > codebehind? For example, something like this:
>
> > ---file1.aspx
> > <%@ Page Language="C#" AutoEventWireup="true" %>
> > <script runat="server">
> > namespace blah
> > {
> > public int data;}
>
> > </script>
>
> > ---file2.aspx
> > <%@ Page Language="C#" AutoEventWireup="true" %>
> > <%@ Import Namespace="blah" %>
> > <script runat="server">
> > protected void Page_Load( object sender, EventArgs e )
> > {
> > data = 1;}
>
> > </script>- Hide quoted text -
>
> - Show quoted text -