Hello there,
I need to be able to call the System.Web.UI.P age object inside a custom
class without actually passing the Page object as an argument. Is there an
alternate way to access the page object from within a class? Something like
the HttpContext.Cur rent object?
My class creates custom scripts that it then adds to the page using
Page.ClientScri pt.IsStartupScr iptRegistered and
Page.ClientScri pt.RegisterStar tupScript functions.
Thanks in advance,
Chris 2 12393
Dim p As Page = CType(System.We b.HttpContext.C urrent.Handler, Page)
--
Teemu Keiski
AspInsider, ASP.NET MVP http://blogs.aspadvice.com/joteke http://teemukeiski.net
"Chris Newald" <cn*****@cars-council.cawrote in message
news:eC******** ******@TK2MSFTN GP03.phx.gbl...
Hello there,
I need to be able to call the System.Web.UI.P age object inside a custom
class without actually passing the Page object as an argument. Is there
an alternate way to access the page object from within a class? Something
like the HttpContext.Cur rent object?
My class creates custom scripts that it then adds to the page using
Page.ClientScri pt.IsStartupScr iptRegistered and
Page.ClientScri pt.RegisterStar tupScript functions.
Thanks in advance,
Chris
This worked great.
The C# version is:
System.Web.UI.P age currentPage;
currentPage = (System.Web.UI. Page)System.Web .HttpContext.Cu rrent.Handler;
Thanks Teemu!
Chris
"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:ej******** ******@TK2MSFTN GP03.phx.gbl...
Dim p As Page = CType(System.We b.HttpContext.C urrent.Handler, Page)
--
Teemu Keiski
AspInsider, ASP.NET MVP http://blogs.aspadvice.com/joteke http://teemukeiski.net
"Chris Newald" <cn*****@cars-council.cawrote in message
news:eC******** ******@TK2MSFTN GP03.phx.gbl...
>Hello there,
I need to be able to call the System.Web.UI.P age object inside a custom class without actually passing the Page object as an argument. Is there an alternate way to access the page object from within a class? Something like the HttpContext.Cur rent object?
My class creates custom scripts that it then adds to the page using Page.ClientScr ipt.IsStartupSc riptRegistered and Page.ClientScr ipt.RegisterSta rtupScript functions.
Thanks in advance, Chris
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Vyas Bharghava |
last post by:
Hi all,
I have written a server-side component that renders some
charts as images. I want to give the charting classes
(Pie, Bar etc.) the ability to render themselves onto any
active page object. I envisage my users calling my
component from Aspx pages like:
Pie pie = new Pie(configXml);
Pie.Render(this);
|
by: Kevin Phifer |
last post by:
Ok, before anyone freaks out, I have a solution I need to
create that gathers content from maybe different places.
Each one can return a <form> in the html, so its the
classic can't have more than one runat=server form on a
asp.net page. However, I still want developers to be able
to use asp.net controls to create some apps that are
created on the page. So I need multiple forms on a
asp.net page(doesn't everyone). I purchased the...
|
by: Bijoy Naick |
last post by:
My project contains multiple aspx pages. Many of these pages have
code-behind that use several helper functions.
Instead of copying each helper function into each aspx page, I am
thinking of using a VB Class file to store these.
Questions -
- How would I "include" this class in each aspx page?
|
by: Axel Dahmen |
last post by:
Hi,
I've added a property to my Page base class (this base class inherits from
Page and all my aspx.cs classes inherit from my base class). This property
of mine uses the Session object to determine its return information.
After implementing this property, whenever I now open any aspx page in the
Visual Studio 7.0 IDE, the following error shows up:
"The file failed to load in the Web form designer. Please correct the
|
by: Mark Rae |
last post by:
Hi,
Is it possible to have programmatic access to the Page object in
Application_BeginRequest, or is it too early in the lifecycle...?
E.g. to be able to change a page's MasterPage dynamically, something like:
protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (Session == "True")
| |
by: Chris |
last post by:
I have a class library which sits in a dll and adds controls to a aspx page
which calls it. I have been passing it the page object. Is there any way I
can reference the page from within the class with out passing it the page
object. Its an extra line of code I could do without.
|
by: feli.hp |
last post by:
Hello all,
Imaybe someone can help me with this question.
Is there a direct way of accessing an object instance, if all I know
is the value of one of its attributes?
The object is part of a list of objects, and I would like to pick the
object directly by using this attribute value, instead of going
through the list and checking if each objects attribute value is the
one I am looking for.
|
by: TonyV |
last post by:
Hey all, for debugging purposes, I'd like to be able to access an
object's instance name from within the object class. For example, I'd
like to be able to do something like this:
------------------------------------------------------------
function FooClass() {
// definition of FooClass members
}
FooClass.prototype.Debug = function() {
|
by: nsphelt |
last post by:
I am wondering if it is possible to access the underlying property of a base class within a derived that has overridden that property. I am using VB.NET and when I use the MyBase keyword to access the property of the base class, it accesses the overridden property instead.
Specifically, my class is inheriting the TextBox class and I am overriding the Text property to have it display something different based on the state of my class. I was...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |