473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

modification in redered text

is there anyway redered html can be checked?
I mean let's say if my aspx redered
<html>
<head></head>
<body>
Hello
</body>
</html>

is there anyway I can check the word Hello and change it to Hi ???

I am talking about checking the redered html out of asp.net

Nov 18 '05 #1
2 1074
Have you looked at Page.Controls[0]? I think you can
traverse the document using this. I havn't tried exactly
what you're doing before.

To see it traverse the controls:

Response.Write(Page.Controls[0].ToString()+"<BR>")
Response.Write(Page.Controls[1].ToString()+"<BR>")
Response.Write(Page.Controls[1].Controls[0].ToString()
+"<BR>")

You should see things like:
System.Web.UI.HtmlControls.HtmlGenericControl
System.Web.UI.WebControls.Button

After you know what control it is, then cast it to the
control type and use the controls methods... like:

System.Web.UI.HtmlControls.HtmlGenericControl div1 =
(System.Web.UI.HtmlControls.HtmlGenericControl)
Page.Controls[2].Controls[0];
div1.InnerText.Replace("Hello!","Hi!");

Or for something more broad you could find the <BODY> and
then use:
bodyControl.InnerHtml.Replace("Hello!","Hi!");

Hope this stir up some ideas!
Nov 18 '05 #2
ok here is what I want.
I have a page index.aspx
currently that page has a word "hello" all over the places.
Currently the word "hello" makes it's way into my test.aspx from various
places (eg. resx files, databases, it's even hard coded most of the places)
Now I want to make that word "hello" to "hi" or maybe in the future the word
"hi" might be replaces to "hello there"

Now I know the application should have been designed in such a way that
these changes should have been made from a database. Well too bad the
designers never though about this. So now what I am thinking is, when
index.aspx is requested there should be something which checks the final
redered html text of the index.aspx and make the replacement and send it to
the client.

I have this feeling that this should be possible. My guess is this has to do
something with API's within IIS that are used to render the final html text?
I need to intercept that... the problem is how can I do it
OR atleast where to start looking for this.

sourcecode
"Will" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
Have you looked at Page.Controls[0]? I think you can
traverse the document using this. I havn't tried exactly
what you're doing before.

To see it traverse the controls:

Response.Write(Page.Controls[0].ToString()+"<BR>")
Response.Write(Page.Controls[1].ToString()+"<BR>")
Response.Write(Page.Controls[1].Controls[0].ToString()
+"<BR>")

You should see things like:
System.Web.UI.HtmlControls.HtmlGenericControl
System.Web.UI.WebControls.Button

After you know what control it is, then cast it to the
control type and use the controls methods... like:

System.Web.UI.HtmlControls.HtmlGenericControl div1 =
(System.Web.UI.HtmlControls.HtmlGenericControl)
Page.Controls[2].Controls[0];
div1.InnerText.Replace("Hello!","Hi!");

Or for something more broad you could find the <BODY> and
then use:
bodyControl.InnerHtml.Replace("Hello!","Hi!");

Hope this stir up some ideas!

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: stan | last post by:
I am working on some documentation in html format and I would really like to display the date the html file, itself was modified. I am writing my documentation in vi and the html server involved is...
2
by: source | last post by:
I have a few hundered pages, where there is one particular text which needs to be formatted in a proper way. Currently the text comes from all different souces(regex files, database and the text is...
2
by: Jeremy | last post by:
Is anyone aware of any features in .NET or 3rd party tools that would enable the automated creation/modification of graphics (e.g., buttons with text in them). I frequently need to modify only the...
9
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected...
7
by: Rich Grise | last post by:
OK, I don't know if this is Off-Topic for the group(s), because "QT" isn't "Pure C++", and Slackware is a distro, but those guys are sharp. :-) And I've crossposted to sci.electroncs.design because...
0
by: Marco Segurini | last post by:
HI, my form contains a combobox and a propertygrid control. At each string of the combobox is associated an object. When I select a string of the combobox the associated object is selected in...
5
by: newb guy | last post by:
Hi, I am interested in knowing how to dynamically modify what browser shows using javascript. I have seen advert programs that put a javascript at the end of html code, and then dynamically...
13
by: ts-dev | last post by:
Is it possible to prevent modification of a python file once its been deployed? File permissions of the OS could be used..but that doesn't seem very secure. The root of my question is verifying...
2
by: Unpopular | last post by:
void directory::modification()//??????????? { clrscr(); cout<< "\n\t @@@@@@ @@@@@ @@@@@ @@@@@@ @@@@@ @ @ @@@@@@ "; cout<< "\n\t=====@ @ @ @ @ @ @@...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.