"oz" <oz@discussions.microsoft.com> wrote
Thanks for the detailed lifecycleof the page...Isn't everything in a web
page suppose to be inside the html and body tags...with the exception of page
directives and header...should asp.net raise an error in this case?
Browsers don't tend to be fussy with errors for this (although the results
of styles and scripts might be less predictable - if you are fussy about
this, you could argue that ASP doesn't produce conforming pages anyway, as
it inludes the invalid ms-positioning property in tags.).
However this is really beyond the point, so I will get back to that. You
really have a few options. If you must use respone.write mixed in with other
code, stick to using it inline, or call procedures that use it from inline
eg
webpage
<% response.write("something") %>
<% aProcedure() %>
code behind and/or server script blocks
Sub aProcedure()
response.write("something else")
End Sub aProcedure
Alternatively use only response.writes to build the whole page, including
the <html> tag etc. (This is a very bad idea).
Finally, use the new fangled way of doing things, and add bits to parts of
the page
eg.
Webpage
<div runat="server" id="theBitToAddStuffTo>
</div>
codebehind
protected withevents theBitToAddStuffTo as System.Web.UI.GenericHTML
theBitToAddStuffTo.innerHTML=theBitToAddStuffTo.in nerHTML+"Some Stuff"
There are I suspect even more, possibly better ways to do it
ME
--
Martin Eyles
ma**********@NOSPAM.bytronic.com