Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global.asax file
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00694438
Message ID:
00694597
Vues:
15
>Have you tried including your code within a script tag inside the global.asax file?
>
>
><script runat="server">
>    <object id="MyObjectName" runat="server" scope="application" class="DotNetClassName" />
></script>
>
>

OK, I think I have partially figured this out. There is, in fact, a file called global.asax that is NOT the one shown in VS.NET. When I attempted to open it directly from withing VS.NET, it brought up the designer screen for it. I opened the file in Notepad instead, and added my &th;object> tag directly in there. Now it's possible to access this object from within my HTML:
<%= Security.noAccessLink %>
That's pretty close to what I want, except I'd also like the same instance of the object available in the global.asax.cs file (from the various events). Unless someone else knows how to do this, I might just give up on that idea and create a property that holds an instance of my object and use that instead. It seems silly to have to have two instances of it, but it's not that big of a deal; some of the properties are defined as static so they're already being shared. Hmm...I suppose I could create a static property that holds a reference to "this". Nah, not worth the trouble (and would probably be confusing).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform