473,395 Members | 1,454 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,395 software developers and data experts.

Deleting everything from a webpage

Hi,

I've written a library that uses just one ASPX file to display many
different pages, and this single ASPX contains only the bare minimum of
HTML, ie. html, head and body elements. Now I have been asked to output
some XML using the same library and ASPX file, so I need a way of being
able to completely remove all traces of the HTML within the ASPX file
and outputting a stream of XML instead.

Is there any way that I can remove *all* content from a page, even the
elements that aren't actually defined within the library? Ie. wipe the
canvas clean and start from scratch?

Cheers,

--
Dylan Parry - http://webpageworkshop.co.uk

A Flower?
Jul 10 '06 #1
3 1066
Dylan Parry wrote:
Is there any way that I can remove *all* content from a page, even the
elements that aren't actually defined within the library? Ie. wipe the
canvas clean and start from scratch?
Typically I have found the answer within moments of asking the question.
It would appear that using "this.Controls.Clear()" will do the trick
just nicely. Of course, I welcome any other suggestions!

--
Dylan Parry - http://electricfreedom.org

A Flower?
Jul 10 '06 #2
Dylan,

While you could certainly do this, why not have a separate page that has
no content in the ASPX part of it, and in the code-behind, returns your XML.
It would definitely be better from a maintinence standpoint.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dylan Parry" <us****@dylanparry.comwrote in message
news:i8**************@dylanparry.com...
Dylan Parry wrote:
>Is there any way that I can remove *all* content from a page, even the
elements that aren't actually defined within the library? Ie. wipe the
canvas clean and start from scratch?

Typically I have found the answer within moments of asking the question.
It would appear that using "this.Controls.Clear()" will do the trick
just nicely. Of course, I welcome any other suggestions!

--
Dylan Parry - http://electricfreedom.org

A Flower?

Jul 10 '06 #3
Nicholas Paldino [.NET/C# MVP] wrote:
While you could certainly do this, why not have a separate page that has
no content in the ASPX part of it, and in the code-behind, returns your XML.
It would definitely be better from a maintinence standpoint.
That's the way I'd normally go about it, but this time I had to reuse
the existing file. The reasons are quite silly, and there's no point in
me arguing with them (management decisions etc), so I'm stuck with my
pseudo-solution ;)

--
Dylan Parry - http://electricfreedom.org

A Flower?
Jul 10 '06 #4

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

Similar topics

8
by: phpfrizzle | last post by:
Hi there, I have built a CMS, and in one part you have to be able to delete images. Structure like this: _root --> folder "img" --> file "1.jpg" --> file "2.jpg" --> folder "CMS" ...
6
by: Amit Kela | last post by:
I am using ASP with SQL for my database. The problem I have is that even after I have ordered certain items from the shopping cart table on the webpage, I cannot remove them - that is the entire...
2
by: Stuart Norris | last post by:
Dear Readers, I am developing an application that stores "messages" in array list and writes new entries to a disk file at the end. This file is used incase the user choses to restart the...
0
by: Bandit | last post by:
I'm populating a gridview (called docList) with document info from a network folder like so: Sub Show_Files(ByVal inputDir As String) Dim strFileNamePath As String = inputDir Dim dirInfo As...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following. I'm trying to delete all the rows in a dataview. There are 200 rows. Everything works fine until I delete half way through and then I'm...
5
by: John Veldthuis | last post by:
My code works perfectly 100% when adding items to my ArrayList and updating the listbox. Works perfectly when deleting an item in the ArrayList when it is not the last entry but if it is the last...
4
by: clintonG | last post by:
I started an application using Beta2 and now I've been having a variety of problems continuing to develop the application in 2.0 that I suspect may be related to left-over icky stuff. What can I...
46
by: DP | last post by:
hi, i've got a form, with a subform in it. i've got a delete button in the subform. the code i;ve got is; Private Sub cmdDeleteRecord_Click() msg = "Are you sure you want to delete this...
1
by: Pat | last post by:
Hi all, I have a really awkward situation that is causing memory leak problems. I'm passing data to a driver, and unfortunately, the driver code is not something I can change, and it is written...
3
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
One more for today.... As I add more and more lines to my RichTextBox the array that holds its strings gets bigger and bigger and the vertical scroll bar gets smaller and smaller until the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
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...

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.