Output without form and viewstate tags

david7777

Freshman
Joined
Feb 17, 2005
Messages
33
Is it possible to output only the generated HTML of an asp.net page?

e.g: I have asp labels and other controls which I work with on the server side. When output to the client, it always includes form tags with all the default hidden viewstate and other fields... I don't want any of those fields or any of the auto generated JavaScript in the output.

I know I can use response.clear and response.write to output exactly what I want, but my problem is that I want asp.net to generate the HTML for me. Is it possible to get the generated HTML for a page before it gets to the client?

I don't need any viewstate enabled.

So that you know, the reason I am doing this is because I am integrating Asynchronous JavaScript and XML (AJAX) into my website. I will have a template with the serverside forms and hidden fields etc, and content will be dynamically loaded into this template... So the client will only load the template, and then according to user input, content will be loaded into the template without posting back by using AJAX. If I do this, I cant have JavaScript and form tags in the content to be dynamically loaded into the template...

I hope I am being clear..? Any suggestions?
 
All I got from that is that you want to disable the view state.

There's a property on the web form and on all the asp controls on the page called EnableViewState. Disable it.

If your just retrieving the info from a form, there's really no need to use asp controls.
 
I have tried to disable all viewstates but the viewstate hidden field is still used... I realise that I dont really need to use asp controls, but I am working with their properties on the server side - Maybe I can just use normal form controls and make them server side so that i can still access their properties..? As long as i have <form> tags in my page though, I assume that the standard hidden fields will still show, no matter what I have within the form tags...
 
try using html controls...As far as I know, view state is only applicable to asp controls.
 
Back
Top