"CES" <ce*@noemaill.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thanks for not answering my question...
I did answer your question. You did not give me a context to go from, so I
made an incorrect assumption.
>I'm just switch over to .net from classic asp and as much as possible I'm
trying to take small steps with concepts I've used in the past and what you
just stated doesn't mean anything to me... yet!
Now I have a context.
ASP is inline coded. It is interpreted one line at a time. ASP.NET is
compiled. This is your first paradigm shift.
You can do
<%
//code here
%>
in ASP.NET, but it is not advised. You are better to bind than to write out
stuff.
For example, you want a copyright date. Here is your old code:
<div id="copyright">
Copyright <%=DateTime.Now.Year.ToString()%- <%=MyWebSite%- All rights
reserved.
<br />Use of this site signifies the users complete agreement to all terms,
contained
<br />& described within the Terms of Use page (Updated July 31, 2008)
</div>
To do this in .NET, you have three choices:
1. Use a class derived from page
2. Use a master page
3. User a control
The master page is probably the best option, if this is all you are doing,
but it is not something you can do to a page without altering it quite a
bit. With the class option, you can pull your ASP tags and with minor
alteration have the page running (it may not do everything the ASP does, but
it will display the copyright).
The user control encapsulates the logic, but you will have to drag it on
every page, which is why the master is so important.
Which of the options you ultimately chose depends on where you want to go.
The best replacement for .inc is a derived class. The best option, long
term, is a master page. If you feel you might use this in multiple sites, a
user control (or even a compiled server control) may be a better option.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#
or just read it:
http://feeds.feedburner.com/GregoryBeamer
********************************************
| Think outside the box! |
********************************************