Select static html elements by tag name in ASP.Net -
Do anyone know that all plain-html & lt; P & gt; Element in an ASP.Net page, server-side? In my case, I want to manipulate all those little text before going into the browser.
I know that I can add Runat = Server and then FindControl for each. But this is a lot of code.
This will be equivalent to getElementsByTagName of JavaScript, but server-side.
Thank you!
You can use browser adapters for the page: just an idea: from the system. Create a browser adapter and render this page override, you will find the HTML generated in the output which will go to the client browser. In this case, you can replace some XSLT mutations, or simple XML (XPAT), and as a result you will complete the mission.
& Lt; / ControlAdapters & gt; & Lt; / Browser & gt; Public Class Test Adapter: Page Adapter {Secure Override Zero Submission (HtmlTextWriter Writer) {/ * Get page output in string / var sb = New StringBuilder (); Text worker tw = new string witter (sb); Var htw = new HtmlTextWriter (tw); // Submit to my author base. Render (HTW); String page = sb.ToString (); // Here you can change the output of the render author. Writite (page); }}
Comments
Post a Comment