Search & Replace in HTML

S

Søren Olesen

Hi

I'm using a thirdparty webgridcontrol on a .aspx page. However I need to
disable one of the childcontrols in this grid. Unfortunately the gridcontrol
doesn't give me any way to do this on the server side.

I could do it in Javascrip... When the page is loaded I could find the
control and just disable it. I've tried that, but the grid contains a lot of
these controls, so it takes quite some time to disable them all, making the
page rather slow to load.

I've therefore created a usercontrol with this webgrid and overloaded the
render method. I'm now able to get hold of the HTML code and therefor able
to change my control using search & replace before it's send to the browser.

However doing search and replace directly on the HTML code seems rather
flaky, so I was wondering if there's a better way....

Is there??

TIA

Søren
 
K

Kevin Spencer

There definitely IS a better way. You need to retrace your steps, back to
where "I'm using a thirdparty webgridcontrol..." The Control doesn't behave
the way you want it to. Now you've spent hours and hours trying to figure
out a hack to make it do so. And the solution (to modify the HTML that is
streamed back) is a hack, a bad hack.

It would take you far less time to create your own User Control using the
various components built in to the .Net Framework as they were designed to
be used, especially over the long haul.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top