So if I include a .cs file inside App_Code I can access this class from a aspx file without compiling? This is really what I am going for. If I compile and push a DLL to the /bin directory, then this causes the Session to be lost, which is undesirable. The alternative is to run the Session differently, but I've read that that causes Session to be slower.
On Feb 3, 2:13 pm, Cerebrus <[email protected]> wrote: > Ummm... App_Code does not contain DLLs. > > On Feb 3, 9:58 pm, jay <[email protected]> wrote: > > > > > 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 -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
