Hidden controls, iframes or divs
What happens to the controls or the iframe or the div, which are hidden? Do they get transferred to the user side?
Disabled: does it get开发者_StackOverflow transferred to the user side?
What I want is,
an aspx page will be having many iframes to display different pages. There will be many div tags to display CSS formatted information.
To understand what I mean by many:- I have to transfer a complete website with 30 aspx pages into one single page!
I have simply combined everything resulting in one extremely huge page.
My concern is that on local host it loads fast, but when on online server accessed by numerous people for education purposes, the site (ONE PAGE) WILL SLOW DOWN terribly.
To overcome this I thought of using hidden and disable options.
What is an improved way of achieving the above?
Yes, it sounds silly but this is the requirement.
Edit: Yes, I know id and server tag must be set, but what I am asking will the div tag be sent to the user's browser? One answer is no.
So can I enable them using JavaScript?
Like
document.getElementById(id).style.visibility="visible"
What if I disable them, and from coding of JavaScript enable them? Will they be loaded at the time of enabling?
Yes, they will be transferred if you hide them with CSS styles only.
Turn your iframe and your div container into a server control by adding an ID and the runat=server
attribute. Then you can programmatically set the .Visible
property to false which prevents the containers to the rendered into the DOM and therefore to be sent to the client.
Use ASP.NET panels. They render out as divs when visible. If they are set to visible = false
the HTML and .NET controls inside them are not rendered to the browser.
精彩评论