Ok, here's the situation:
I want to read the currently executing .aspx page "source code" from memory
as it is executing so I can grab certain values from within the page (for
example, say the page title). Any ideas?
Chad 15 1235
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:Ol******** ******@TK2MSFTN GP10.phx.gbl... Ok, here's the situation:
I want to read the currently executing .aspx page "source code" from
memory as it is executing so I can grab certain values from within the page (for example, say the page title). Any ideas?
Chad, I've already told you "no". The source code is not in memory at all.
It will already have been compiled.
It's not like you're on the client and can use the DOM.
--
John Saunders
johnwsaundersii i at hotmail
Ok, ok, just trying to figure out different ways... :)
I can use a streamreader and open up the file, place the contents into a
string, and use a regular expression, right? How much server load do you
think that will add?
Chad
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. "Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:Ol******** ******@TK2MSFTN GP10.phx.gbl... Ok, here's the situation:
I want to read the currently executing .aspx page "source code" from memory as it is executing so I can grab certain values from within the page
(for example, say the page title). Any ideas?
Chad, I've already told you "no". The source code is not in memory at all. It will already have been compiled.
It's not like you're on the client and can use the DOM. -- John Saunders johnwsaundersii i at hotmail
Ok, ok, I was just looking into all possibilities. :-)
How much overhead would a file reader add?
Chad
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. "Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:Ol******** ******@TK2MSFTN GP10.phx.gbl... Ok, here's the situation:
I want to read the currently executing .aspx page "source code" from memory as it is executing so I can grab certain values from within the page
(for example, say the page title). Any ideas?
Chad, I've already told you "no". The source code is not in memory at all. It will already have been compiled.
It's not like you're on the client and can use the DOM. -- John Saunders johnwsaundersii i at hotmail
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Ok, ok, I was just looking into all possibilities. :-)
How much overhead would a file reader add?
Chad
Chad, surely there's a better way to do this? I think you should consider
re-evaluating your requirements.
What if the <title> tag doesn't actually appear in the .aspx file? It can be
generated by script, for instance. It could also be generated within a user
control or a custom server control. In this case, you'll never see it.
You said that you need access to the title and to the meta tags. Did you
realize that you can turn both into server controls simply by adding
runat="server"?
<html>
<head>
<title runat="server" id="myTitle">So me Title</title>
<meta runat="server" id="myMeta1" name="GENERATOR " content="Micros oft
Visual Studio.NET 7.0">
</head>
<body>
<!-- Whatever -->
</body>
</html>
Both myTitle and myMeta1 will appear in your codebehind as
HtmlGenericCont rol instances, and you'll be able to access their attributes,
InnerText and InnerHtml.
--
John Saunders
johnwsaundersii i at hotmail
Agreed, but the (main) problem is that I am going to be serving templated
..htm files, which will run through asp.net. I need to retain the title and
meta tags. If you have a better idea of how to do this, trust me, I'm all
ears (well, actually, in this case, eyes... :)) We have files published
that our users edit, in .htm format, and I really don't want to have to
change all them over to .aspx files everytime they get updated (or change
the 2000+ files we already have). Thoughts?
(and thanks!)
Chad
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:ug******** ******@TK2MSFTN GP09.phx.gbl... "Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Ok, ok, I was just looking into all possibilities. :-)
How much overhead would a file reader add?
Chad Chad, surely there's a better way to do this? I think you should consider re-evaluating your requirements.
What if the <title> tag doesn't actually appear in the .aspx file? It can
be generated by script, for instance. It could also be generated within a
user control or a custom server control. In this case, you'll never see it.
You said that you need access to the title and to the meta tags. Did you realize that you can turn both into server controls simply by adding runat="server"?
<html> <head> <title runat="server" id="myTitle">So me Title</title> <meta runat="server" id="myMeta1" name="GENERATOR " content="Micros oft Visual Studio.NET 7.0"> </head> <body> <!-- Whatever --> </body> </html>
Both myTitle and myMeta1 will appear in your codebehind as HtmlGenericCont rol instances, and you'll be able to access their
attributes, InnerText and InnerHtml. -- John Saunders johnwsaundersii i at hotmail
try a httphandler.
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:#W******** ******@TK2MSFTN GP11.phx.gbl... Agreed, but the (main) problem is that I am going to be serving templated .htm files, which will run through asp.net. I need to retain the title
and meta tags. If you have a better idea of how to do this, trust me, I'm all ears (well, actually, in this case, eyes... :)) We have files published that our users edit, in .htm format, and I really don't want to have to change all them over to .aspx files everytime they get updated (or change the 2000+ files we already have). Thoughts?
(and thanks!)
Chad
"John Saunders" <jo************ **@notcoldmail. com> wrote in message news:ug******** ******@TK2MSFTN GP09.phx.gbl... "Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Ok, ok, I was just looking into all possibilities. :-)
How much overhead would a file reader add?
Chad Chad, surely there's a better way to do this? I think you should
consider re-evaluating your requirements.
What if the <title> tag doesn't actually appear in the .aspx file? It
can be generated by script, for instance. It could also be generated within a user control or a custom server control. In this case, you'll never see it.
You said that you need access to the title and to the meta tags. Did you realize that you can turn both into server controls simply by adding runat="server"?
<html> <head> <title runat="server" id="myTitle">So me Title</title> <meta runat="server" id="myMeta1" name="GENERATOR "
content="Micros oft Visual Studio.NET 7.0"> </head> <body> <!-- Whatever --> </body> </html>
Both myTitle and myMeta1 will appear in your codebehind as HtmlGenericCont rol instances, and you'll be able to access their attributes, InnerText and InnerHtml. -- John Saunders johnwsaundersii i at hotmail
You're barking way up the wrong tree here, Chad. Forget about source code.
Think about objects. The Page is an object. The Page title is an object. In
..Net, Everything is an object.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:Ol******** ******@TK2MSFTN GP10.phx.gbl... Ok, here's the situation:
I want to read the currently executing .aspx page "source code" from
memory as it is executing so I can grab certain values from within the page (for example, say the page title). Any ideas?
Chad
Ok, how would I get the page title using a HTTPHandler? (sorry, somewhat new
to HTTPHandlers). I know I can route requests for .htm files to be
processed by the asp.net compiler, etc, but how would I retrieve the title
of a page?
Chad
"bruce barker" <no***********@ safeco.com> wrote in message
news:ue******** ******@TK2MSFTN GP09.phx.gbl... try a httphandler.
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:#W******** ******@TK2MSFTN GP11.phx.gbl... Agreed, but the (main) problem is that I am going to be serving
templated .htm files, which will run through asp.net. I need to retain the title and meta tags. If you have a better idea of how to do this, trust me, I'm
all ears (well, actually, in this case, eyes... :)) We have files published that our users edit, in .htm format, and I really don't want to have to change all them over to .aspx files everytime they get updated (or
change the 2000+ files we already have). Thoughts?
(and thanks!)
Chad
"John Saunders" <jo************ **@notcoldmail. com> wrote in message news:ug******** ******@TK2MSFTN GP09.phx.gbl... "Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. > Ok, ok, I was just looking into all possibilities. :-) > > How much overhead would a file reader add? > > Chad
Chad, surely there's a better way to do this? I think you should consider re-evaluating your requirements.
What if the <title> tag doesn't actually appear in the .aspx file? It can be generated by script, for instance. It could also be generated within a user control or a custom server control. In this case, you'll never see it.
You said that you need access to the title and to the meta tags. Did
you realize that you can turn both into server controls simply by adding runat="server"?
<html> <head> <title runat="server" id="myTitle">So me Title</title> <meta runat="server" id="myMeta1" name="GENERATOR " content="Micros oft Visual Studio.NET 7.0"> </head> <body> <!-- Whatever --> </body> </html>
Both myTitle and myMeta1 will appear in your codebehind as HtmlGenericCont rol instances, and you'll be able to access their
attributes, InnerText and InnerHtml. -- John Saunders johnwsaundersii i at hotmail
That was my ititial thoughts, but I can't figure out how to access a page's
title element!! :-( I can't add "runat=serv er" to all our .htm pages, it
just isn't possible. Do you have an example that I could investigate?
Thanks
Chad
"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:uf******** ******@TK2MSFTN GP09.phx.gbl... You're barking way up the wrong tree here, Chad. Forget about source code. Think about objects. The Page is an object. The Page title is an object.
In .Net, Everything is an object.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message news:Ol******** ******@TK2MSFTN GP10.phx.gbl... Ok, here's the situation:
I want to read the currently executing .aspx page "source code" from memory as it is executing so I can grab certain values from within the page
(for example, say the page title). Any ideas?
Chad
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Lane Friesen |
last post by:
I've developed a new form of client-based, secure 'Web Memory' that
uses the JAVA or dotNET VM to launch a 'terminate and stay
resident' program fragment that maintains persistence between web
pages by program reloading. Web Memory is the basis for an Open Source
e-commerce front end that could reduce web congestion and simplify
online shopping.
If too many people use this technique, then it will not work for
anyone. Bandwidth for Web...
|
by: Sune |
last post by:
Hi!
Pre-requisites:
-------------------
1) Consider I'm about to write a quite large program. Say 500 K
lines.
2) Part of this code will consist of 50 structs with, say, no more
than at most 1K bytes of data.
3) These structs are to be used by all of the other 500K lines in
various places.
|
by: Barkha Shah |
last post by:
Hi All,
I am looking for a tool/utility that converts the address into source code
line.
Purpose is that I have written a basic mfc application that purposely has a
memory leak.Now at the exit of the application I get a memory dump in the
output window as mentioned below. Its a simple program that I know where the
memory leak is but in the bigger application I am not able to figure out
source code line. Any help on this respect would be...
|
by: J-T |
last post by:
Hi All,
There is a picture on the following URL which I want to have it in one of
my asp.net pages .I mean I want to embed the content of this page in my own
page and get its image.Is there a control or tecnique which I can
accomplish this?
http://www.tehrantraffic.com/gif.asp?g=cam3_ttcc_00001.jpg&t=TTCC%20website
Thanks a lot
|
by: Jim712 |
last post by:
I am trying to embed an aspx page within another aspx page. Is it possible
to persist the data to the embedded page?
| |
by: scottyman |
last post by:
I can't make this script work properly. I've gone as far as I can with
it and the rest is out of my ability. I can do some html editing but
I'm lost in the Java world. The script at the bottom of the html page
controls the form fields that are required. It doesn't function like
it's supposed to and I can leave all the fields blank and it still
submits the form. Also I can't get it to transfer the file in the
upload section. The file name...
|
by: Matt Kruse |
last post by:
I'm using Drip 0.5 to test for a memory leak in some code. After reducing
the page down bit by bit to find the leak, I ended up with an empty page
that still leaked!
The page source is exactly this:
<html>
<head><title></title></head>
<body></body>
</html>
|
by: Polar |
last post by:
Hello everyone! I'm new here.
I am doing a project, Digital Compass Navigation Aids. It consists of the 1490 Digital Compass, a P18F4620 Microcontroller, ISD2560 voice record/playback chip LM4808M amplifier, 5volts and 3.3volts voltage regulators and three switches, the recording switch, the playback switch. First, i should record north, south, east and west into the chip by pressing SW3. Then by pressing SW4, it should playback my voice.
...
|
by: graham.keellings |
last post by:
hi,
I'm looking for an open source memory pool. It's for use on an
embedded system, if that makes any difference. Something with garbage
collection/defragmentation would be nice. It should have the ability
to allocate different size chunks of memory not just a single size. It
should error check for double free, etc. And it should be usable by a
mixture of C and C++ subsystems.
If I get that, I'm happy. Thank you very much.
|
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:
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |