Not sure why you need what you want, but ... it's not in my head, i.e. I have not tried this code.
Add the onclick client side to your button to show the markup, and do something like this:
function showMarkup() { var markup = "<html>" + document.getElementsByTagName("html")[0].innerHTML + "</html>"; alert(markup);
If you need this rendering markup sent to the server for any reason, store the encoded markup in a hidden input and send it back. You can register the script below on the server side using ClientScriptManager.RegisterOnSubmitStatement. Here is the code with cleint-side.
var markup = escape("<html>" + document.getElementsByTagName("html")[0].innerHTML + "</html>"); var hiddenInput = $get('hiddenInputClientId'); if (hiddenInput) { hiddenInput.value = markup; }
Hope this helps, Nick
nickytonline
source share