473,396 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I have fixed ASP.NET check it out

This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5

Nov 19 '05 #1
23 1594
You should fix the way you refer to ASP.NET as ASP,
and explain why you use the .asp extension, in ASP.NET,
instead of using .aspx.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5

Nov 19 '05 #2
Hi John,
This shows you how to implement html rendering methods and libraries
in ASPX pages.

This also means super fast debugging as no re-initialising of IIS is
required after editting!

This gets around the ridiculous situation of ASPX pages not being
allowed to have methods.


I would apply for a job with the asp.net team. I think these guys realy could
use you :)

Of course aspx files can have methods :

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

Sub Output()
Response.Write("Hi John. I'm a method, really")
End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% Output()%>
</div>
</form>
</body>
</html>

Cheers,
Tom Pester
Nov 19 '05 #3

i meant methods with codeblocks

as you well know

you guys are still too dumb to get it

somebody at microsoft sat down

and decided no methods with codeblocks

why?

it is possible - i just did it

and it has simplified my asp.net evaluation project
significantly

for example, how would you do this?

void RenderMenuItem(string Title, string Link) {
%><tr>
<td style="background-image:url(Images/MenuItem.gif)"
height="22">&nbsp;&nbsp;<img
src="Images/ArrowGrey.gif"/>&nbsp;&nbsp;<b><a
href="<%=HTML(Link)%>"><%=HTML(Title)%></a></b></td>
</td>
</tr><%
}

such a simple thing

yet how would you do this in .net?

response.write is ridiculous - this is a chunk of html, where is color
coding and completion, let alone copy and paste from html page etc.

user controls are ridiculous - what if i wanted 12 menu items generated
dynamically?

custom controls are also ridiculous

can you not see that the CORRECT approach is the one from Classic ASP?

and that this situation is extremely strange and suspect?


tom pester wrote:
Hi John,
This shows you how to implement html rendering methods and libraries
in ASPX pages.

This also means super fast debugging as no re-initialising of IIS is
required after editting!

This gets around the ridiculous situation of ASPX pages not being
allowed to have methods.


I would apply for a job with the asp.net team. I think these guys realy could
use you :)

Of course aspx files can have methods :

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

Sub Output()
Response.Write("Hi John. I'm a method, really")
End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% Output()%>
</div>
</form>
</body>
</html>

Cheers,
Tom Pester


Nov 19 '05 #4


why would you reply about a typo

and not reply constructively to the point in hand?

what are you a human spell checker?

hit F7 and Juan will come and check your stuff ...

like a spell checker he won't understand the words and sentences ...

ha ha ha
Juan T. Llibre wrote:
You should fix the way you refer to ASP.NET as ASP,
and explain why you use the .asp extension, in ASP.NET,
instead of using .aspx.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5


Nov 19 '05 #5
re:
you guys are still too dumb to get it
Yup. That is *exactly* your problem.
Everybody's dumb...except you.

Bye...

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
i meant methods with codeblocks
as you well know

you guys are still too dumb to get it
somebody at microsoft sat down
and decided no methods with codeblocks

why?

it is possible - i just did it

and it has simplified my asp.net evaluation project
significantly

for example, how would you do this?

void RenderMenuItem(string Title, string Link) {
%><tr>
<td style="background-image:url(Images/MenuItem.gif)"
height="22">&nbsp;&nbsp;<img
src="Images/ArrowGrey.gif"/>&nbsp;&nbsp;<b><a
href="<%=HTML(Link)%>"><%=HTML(Title)%></a></b></td>
</td>
</tr><%
}

such a simple thing
yet how would you do this in .net?

response.write is ridiculous - this is a chunk of html, where is color
coding and completion, let alone copy and paste from html page etc.

user controls are ridiculous - what if i wanted 12 menu items generated
dynamically?

custom controls are also ridiculous
can you not see that the CORRECT approach is the one from Classic ASP?
and that this situation is extremely strange and suspect? tom pester wrote:
Hi John,
> This shows you how to implement html rendering methods and libraries
> in ASPX pages.
>
> This also means super fast debugging as no re-initialising of IIS is
> required after editting!
>
> This gets around the ridiculous situation of ASPX pages not being
> allowed to have methods.


I would apply for a job with the asp.net team. I think these guys realy could
use you :)

Of course aspx files can have methods :

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

Sub Output()
Response.Write("Hi John. I'm a method, really")
End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% Output()%>
</div>
</form>
</body>
</html>

Cheers,
Tom Pester

Nov 19 '05 #6
1. You cannot fix something you don't understand. How could you fix, for
example, a watch, if you didn't know how it works?
2. An ASP.Net Page is a class. All classes can have methods.
3. Making ASP.Net procedural is a step backwards not a step forwards.
4. ASP.Net was developed over more than 6 years by architects, designers,
and programmers who make most of us look like amateurs. What you have done
is the equivalent of what Mr. Bean did to the Mona Lisa.
5. If you don't want to learn, stick to ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Paranoia is just a state of mind.

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5

Nov 19 '05 #7
> What you have done is the equivalent of what Mr. Bean did to the Mona Lisa.

'Winslow's Mother' was the actual name of the painting. Still the
funniest reply I have yet to read on this newsgroup.

Nov 19 '05 #8
A typo is something that happens once.

Careless posting happens when you include
several typos in the same post, as it did in your post.

Or, maybe, you're so fixated on ASP, that you
-mindlessly- write asp when you mean to write aspx.

In any case, I won't waste any more time on your posts.

<plonk>

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

why would you reply about a typo
and not reply constructively to the point in hand?

what are you a human spell checker?
hit F7 and Juan will come and check your stuff ...

like a spell checker he won't understand the words and sentences ...
ha ha ha
Juan T. Llibre wrote:
You should fix the way you refer to ASP.NET as ASP,
and explain why you use the .asp extension, in ASP.NET,
instead of using .aspx.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5

Nov 19 '05 #9

coding horror :
void RenderMenuItem(string Title, string Link) {
%><tr>
<td style="background-image:url(Images/MenuItem.gif)"
height="22">&nbsp;&nbsp;<img
src="Images/ArrowGrey.gif"/>&nbsp;&nbsp;<b><a
href="<%=HTML(Link)%>"><%=HTML(Title)%></a></b></td>
</td>
</tr><%
}
much better :

str &= "<tr><td class=c1>"
str &= "<img src=""Images/ArrowGrey.gif"" />"
str &= String.Format("<a class=c2 href=""{0}"">{0}</a>", Link)
str &= "</td></tr>"

Make a user control if you want HTML designer support. ASP.NET doesnt suppor
render functions, get over it?
i meant methods with codeblocks
You mean rendering functions I suppose.

After reading some of your comments in the other posts I see that you don't
understand asp.net yet. So don't expect any serious responses after you do.

Cheers,
Tom Pester
i meant methods with codeblocks

as you well know

you guys are still too dumb to get it

somebody at microsoft sat down

and decided no methods with codeblocks

why?

it is possible - i just did it

and it has simplified my asp.net evaluation project significantly

for example, how would you do this?

void RenderMenuItem(string Title, string Link) {
%><tr>
<td style="background-image:url(Images/MenuItem.gif)"
height="22">&nbsp;&nbsp;<img
src="Images/ArrowGrey.gif"/>&nbsp;&nbsp;<b><a
href="<%=HTML(Link)%>"><%=HTML(Title)%></a></b></td>
</td>
</tr><%
}
such a simple thing

yet how would you do this in .net?

response.write is ridiculous - this is a chunk of html, where is color
coding and completion, let alone copy and paste from html page etc.

user controls are ridiculous - what if i wanted 12 menu items
generated dynamically?

custom controls are also ridiculous

can you not see that the CORRECT approach is the one from Classic ASP?

and that this situation is extremely strange and suspect?

tom pester wrote:
Hi John,
This shows you how to implement html rendering methods and libraries
in ASPX pages.

This also means super fast debugging as no re-initialising of IIS is
required after editting!

This gets around the ridiculous situation of ASPX pages not being
allowed to have methods.

I would apply for a job with the asp.net team. I think these guys
realy could use you :)

Of course aspx files can have methods :

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

Sub Output()
Response.Write("Hi John. I'm a method, really")
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% Output()%>
</div>
</form>
</body>
</html>
Cheers,
Tom Peste

Nov 19 '05 #10
I think the fact that this guy submitted a topic about fixing a
framework with 1000's of classes has something to say about his common
sense, or lack thereof.

I think his next move is to try and teach Stephen Hawkins a thing or
two about Astrophysics.

Nov 19 '05 #11
"Sparky Arbuckle" <tw*@secureroot.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
'Winslow's Mother' was the actual name of the painting.


It was Whistler's Mother when I saw it...
Nov 19 '05 #12
"tom pester" <To********************@pandora.be> wrote in message
news:a1***************************@news.microsoft. com...
After reading some of your comments in the other posts I see that you
don't understand asp.net yet. So don't expect any serious responses after
you do.


If that ever happens...
Nov 19 '05 #13
hahahahhaa Kevin this one of the funniest thing i read today..
Thanks for that.
And Juan lets not waste time with such people in this forum:(
Patrick
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...
1. You cannot fix something you don't understand. How could you fix, for
example, a watch, if you didn't know how it works?
2. An ASP.Net Page is a class. All classes can have methods.
3. Making ASP.Net procedural is a step backwards not a step forwards.
4. ASP.Net was developed over more than 6 years by architects, designers,
and programmers who make most of us look like amateurs. What you have done
is the equivalent of what Mr. Bean did to the Mona Lisa.
5. If you don't want to learn, stick to ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Paranoia is just a state of mind.

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5


Nov 19 '05 #14
"John Rivers" <fi*****@btinternet.com> wrote in
news:11**********************@g44g2000cwa.googlegr oups.com:
for example, how would you do this?

void RenderMenuItem(string Title, string Link) {
%><tr>
<td style="background-image:url(Images/MenuItem.gif)"
height="22">&nbsp;&nbsp;<img
src="Images/ArrowGrey.gif"/>&nbsp;&nbsp;<b><a
href="<%=HTML(Link)%>"><%=HTML(Title)%></a></b></td>
</td>
</tr><%
}


I wouldn't... what a bunch of gobbly goop. If you want this style of
coding, I suggest you stick with ASP, PHP or Perl.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #15
I'm in that mood already, Patrick... ;-)

Juan
====

"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
hahahahhaa Kevin this one of the funniest thing i read today..
Thanks for that.
And Juan lets not waste time with such people in this forum:(
Patrick
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...
1. You cannot fix something you don't understand. How could you fix, for
example, a watch, if you didn't know how it works?
2. An ASP.Net Page is a class. All classes can have methods.
3. Making ASP.Net procedural is a step backwards not a step forwards.
4. ASP.Net was developed over more than 6 years by architects, designers,
and programmers who make most of us look like amateurs. What you have done
is the equivalent of what Mr. Bean did to the Mona Lisa.
5. If you don't want to learn, stick to ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Paranoia is just a state of mind.

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
> This shows you how to implement html rendering methods
> and libraries in ASPX pages.
>
> This also means super fast debugging as no re-initialising
> of IIS is required after editting!
>
> This gets around the ridiculous situation of ASPX pages
> not being allowed to have methods.
>
> I am working on a way to do this with classes as well!
>
> Here is how to do it:
>
> you will create two ASPX pages:
>
> - FixASP.asp (the page that actually gets called)
> - Library.asp (the page that provides library methods to FixASP.asp)
>
> the key thing to note is that we are tricking the ASP.NET compiler
> by closing the hidden render method with a brace, then we omit
> the last closing brace of our code because ASP.NET will put it in for
> us!
>
> Contents of FixASP.asp:
>
> (start)
> <%
> InitLib(__output, parameterContainer);
> PageStart("ASP.NET is sane again!");
> PageHeader();
> PageMethod();
> PageFooter();
> PageEnd();
> %><!--#Include File="Library.aspx"--><%
> }
> void PageMethod() {
> %>this is the page method<%
> %>
> (end)
>
> Contents of Library.asp:
>
> (start)
> <%}
> //Don't change this bit
> private System.Web.UI.HtmlTextWriter __output;
> private System.Web.UI.Control parameterContainer;
> void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
> {
> __output = o;
> parameterContainer = pc;
> }
> //Convenience methods go here
> string HTML(string data) {
> return HttpUtility.HtmlEncode(data);
> }
> string URL(string data) {
> return HttpUtility.UrlEncode(data);
> }
> string QPX(string name, string val) {
> return URL(name) + "=" + URL(val) + "&";
> }
> //Add your rendering methods here!
> void RenderLink(string Title, string URL) {
> %><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
> }
> void PageStart(string Title) {
> %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html>
> <head>
> <title><%=HTML(Title)%></title>
> </head>
> <body><%
> }
> void PageHeader() {
> %><h1>This is the page header</h1><hr/><%
> }
> void PageFooter() {
> %><hr/><h1>This is the page footer</h1><%
> }
> void PageEnd() {
> %></body>
> </html><%
> }
> //Don't change anything after this
> void ButtPlug() {
> //this is the end
> %>
> (end)
>
> now set FixASP.asp as your StartPage
> and hit F5
>



Nov 19 '05 #16
> 'Winslow's Mother' was the actual name of the painting.

Darned if you aren't right! I'll have to watch it again!

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
Paranoia is just a state of mind.

"Sparky Arbuckle" <tw*@secureroot.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
What you have done is the equivalent of what Mr. Bean did to the Mona
Lisa.


'Winslow's Mother' was the actual name of the painting. Still the
funniest reply I have yet to read on this newsgroup.

Nov 19 '05 #17
> It was Whistler's Mother when I saw it...

Gosh! I was wrong again, saying that Sparky was right! That makes me wrong
twice! In a row!

Time to drink some coffee, I suppose...

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
Paranoia is just a state of mind.

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:u4**************@TK2MSFTNGP14.phx.gbl...
"Sparky Arbuckle" <tw*@secureroot.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
'Winslow's Mother' was the actual name of the painting.


It was Whistler's Mother when I saw it...

Nov 19 '05 #18
Howdy,

John, I've just had a look on two topics created by you (this and about
debugging). Just go back your lovely VB and ASP technologies and stop making
annoying posts :)
ASP.NET is object oriented platform with quite nice background, designed to
make web programming faster and what is more important – to put some order in
big projects. I’ve seen some many messy ASP and VB applications written in
the same way you showed above. My advice John is to start understanding the
idea of new technologies and to stop complaining about everything what’s
different you got used to or you don’t understand.

Regards

Milosz Skalecki
MCP, MCAD

"John Rivers" wrote:
This shows you how to implement html rendering methods
and libraries in ASPX pages.

This also means super fast debugging as no re-initialising
of IIS is required after editting!

This gets around the ridiculous situation of ASPX pages
not being allowed to have methods.

I am working on a way to do this with classes as well!

Here is how to do it:

you will create two ASPX pages:

- FixASP.asp (the page that actually gets called)
- Library.asp (the page that provides library methods to FixASP.asp)

the key thing to note is that we are tricking the ASP.NET compiler
by closing the hidden render method with a brace, then we omit
the last closing brace of our code because ASP.NET will put it in for
us!

Contents of FixASP.asp:

(start)
<%
InitLib(__output, parameterContainer);
PageStart("ASP.NET is sane again!");
PageHeader();
PageMethod();
PageFooter();
PageEnd();
%><!--#Include File="Library.aspx"--><%
}
void PageMethod() {
%>this is the page method<%
%>
(end)

Contents of Library.asp:

(start)
<%}
//Don't change this bit
private System.Web.UI.HtmlTextWriter __output;
private System.Web.UI.Control parameterContainer;
void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
{
__output = o;
parameterContainer = pc;
}
//Convenience methods go here
string HTML(string data) {
return HttpUtility.HtmlEncode(data);
}
string URL(string data) {
return HttpUtility.UrlEncode(data);
}
string QPX(string name, string val) {
return URL(name) + "=" + URL(val) + "&";
}
//Add your rendering methods here!
void RenderLink(string Title, string URL) {
%><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
}
void PageStart(string Title) {
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title><%=HTML(Title)%></title>
</head>
<body><%
}
void PageHeader() {
%><h1>This is the page header</h1><hr/><%
}
void PageFooter() {
%><hr/><h1>This is the page footer</h1><%
}
void PageEnd() {
%></body>
</html><%
}
//Don't change anything after this
void ButtPlug() {
//this is the end
%>
(end)

now set FixASP.asp as your StartPage
and hit F5

Nov 19 '05 #19
John Rivers wrote:

i meant methods with codeblocks

as you well know

you guys are still too dumb to get it

somebody at microsoft sat down

and decided no methods with codeblocks

why?

it is possible - i just did it

and it has simplified my asp.net evaluation project
significantly

for example, how would you do this?

void RenderMenuItem(string Title, string Link) {
%><tr>
<td style="background-image:url(Images/MenuItem.gif)"
height="22">&nbsp;&nbsp;<img
src="Images/ArrowGrey.gif"/>&nbsp;&nbsp;<b><a
href="<%=HTML(Link)%>"><%=HTML(Title)%></a></b></td>
</td>
</tr><%
}

such a simple thing

yet how would you do this in .net?


Not at all (see Web Controls).

But if you seem to miss JSP programming as practiced in the year 2000,
go ahead.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #20
microsoft really needs an AI software to keep an eye on this newsgroup. They
listed this discussion under their hot discussions section, and the
discussions are really ridiculous.

"Juan T. Llibre" wrote:
I'm in that mood already, Patrick... ;-)

Juan
====

"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
hahahahhaa Kevin this one of the funniest thing i read today..
Thanks for that.
And Juan lets not waste time with such people in this forum:(
Patrick
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...
1. You cannot fix something you don't understand. How could you fix, for
example, a watch, if you didn't know how it works?
2. An ASP.Net Page is a class. All classes can have methods.
3. Making ASP.Net procedural is a step backwards not a step forwards.
4. ASP.Net was developed over more than 6 years by architects, designers,
and programmers who make most of us look like amateurs. What you have done
is the equivalent of what Mr. Bean did to the Mona Lisa.
5. If you don't want to learn, stick to ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Paranoia is just a state of mind.

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
> This shows you how to implement html rendering methods
> and libraries in ASPX pages.
>
> This also means super fast debugging as no re-initialising
> of IIS is required after editting!
>
> This gets around the ridiculous situation of ASPX pages
> not being allowed to have methods.
>
> I am working on a way to do this with classes as well!
>
> Here is how to do it:
>
> you will create two ASPX pages:
>
> - FixASP.asp (the page that actually gets called)
> - Library.asp (the page that provides library methods to FixASP.asp)
>
> the key thing to note is that we are tricking the ASP.NET compiler
> by closing the hidden render method with a brace, then we omit
> the last closing brace of our code because ASP.NET will put it in for
> us!
>
> Contents of FixASP.asp:
>
> (start)
> <%
> InitLib(__output, parameterContainer);
> PageStart("ASP.NET is sane again!");
> PageHeader();
> PageMethod();
> PageFooter();
> PageEnd();
> %><!--#Include File="Library.aspx"--><%
> }
> void PageMethod() {
> %>this is the page method<%
> %>
> (end)
>
> Contents of Library.asp:
>
> (start)
> <%}
> //Don't change this bit
> private System.Web.UI.HtmlTextWriter __output;
> private System.Web.UI.Control parameterContainer;
> void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
> {
> __output = o;
> parameterContainer = pc;
> }
> //Convenience methods go here
> string HTML(string data) {
> return HttpUtility.HtmlEncode(data);
> }
> string URL(string data) {
> return HttpUtility.UrlEncode(data);
> }
> string QPX(string name, string val) {
> return URL(name) + "=" + URL(val) + "&";
> }
> //Add your rendering methods here!
> void RenderLink(string Title, string URL) {
> %><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
> }
> void PageStart(string Title) {
> %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html>
> <head>
> <title><%=HTML(Title)%></title>
> </head>
> <body><%
> }
> void PageHeader() {
> %><h1>This is the page header</h1><hr/><%
> }
> void PageFooter() {
> %><hr/><h1>This is the page footer</h1><%
> }
> void PageEnd() {
> %></body>
> </html><%
> }
> //Don't change anything after this
> void ButtPlug() {
> //this is the end
> %>
> (end)
>
> now set FixASP.asp as your StartPage
> and hit F5
>



Nov 19 '05 #21

Where can you see if a discussion is hot?

Cheers,
Tom Pester
microsoft really needs an AI software to keep an eye on this
newsgroup. They listed this discussion under their hot discussions
section, and the discussions are really ridiculous.

"Juan T. Llibre" wrote:
I'm in that mood already, Patrick... ;-)

Juan
====
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
hahahahhaa Kevin this one of the funniest thing i read today..
Thanks for that.
And Juan lets not waste time with such people in this forum:(
Patrick
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...

1. You cannot fix something you don't understand. How could you
fix, for
example, a watch, if you didn't know how it works?
2. An ASP.Net Page is a class. All classes can have methods.
3. Making ASP.Net procedural is a step backwards not a step
forwards.
4. ASP.Net was developed over more than 6 years by architects,
designers,
and programmers who make most of us look like amateurs. What you
have done
is the equivalent of what Mr. Bean did to the Mona Lisa.
5. If you don't want to learn, stick to ASP.
-- HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Paranoia is just a state of mind.
"John Rivers" <fi*****@btinternet.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...

> This shows you how to implement html rendering methods and
> libraries in ASPX pages.
>
> This also means super fast debugging as no re-initialising of IIS
> is required after editting!
>
> This gets around the ridiculous situation of ASPX pages not being
> allowed to have methods.
>
> I am working on a way to do this with classes as well!
>
> Here is how to do it:
>
> you will create two ASPX pages:
>
> - FixASP.asp (the page that actually gets called)
> - Library.asp (the page that provides library methods to
> FixASP.asp)
> the key thing to note is that we are tricking the ASP.NET compiler
> by closing the hidden render method with a brace, then we omit
> the last closing brace of our code because ASP.NET will put it in
> for
> us!
> Contents of FixASP.asp:
>
> (start)
> <%
> InitLib(__output, parameterContainer);
> PageStart("ASP.NET is sane again!");
> PageHeader();
> PageMethod();
> PageFooter();
> PageEnd();
> %><!--#Include File="Library.aspx"--><%
> }
> void PageMethod() {
> %>this is the page method<%
> %>
> (end)
> Contents of Library.asp:
>
> (start)
> <%}
> //Don't change this bit
> private System.Web.UI.HtmlTextWriter __output;
> private System.Web.UI.Control parameterContainer;
> void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control
> pc)
> {
> __output = o;
> parameterContainer = pc;
> }
> //Convenience methods go here
> string HTML(string data) {
> return HttpUtility.HtmlEncode(data);
> }
> string URL(string data) {
> return HttpUtility.UrlEncode(data);
> }
> string QPX(string name, string val) {
> return URL(name) + "=" + URL(val) + "&";
> }
> //Add your rendering methods here!
> void RenderLink(string Title, string URL) {
> %><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
> }
> void PageStart(string Title) {
> %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html>
> <head>
> <title><%=HTML(Title)%></title>
> </head>
> <body><%
> }
> void PageHeader() {
> %><h1>This is the page header</h1><hr/><%
> }
> void PageFooter() {
> %><hr/><h1>This is the page footer</h1><%
> }
> void PageEnd() {
> %></body>
> </html><%
> }
> //Don't change anything after this
> void ButtPlug() {
> //this is the end
> %>
> (end)
> now set FixASP.asp as your StartPage
> and hit F5

Nov 19 '05 #22
> the discussions are really ridiculous.

That blanket statement is not logical. There are some people who post
ridiculous things in this group. However, for the most part, the discussions
here are serious Q&A regarding problems that people have. This is a public
newsgroup, and nobody is "locked out" from posting here. As there are all
kinds of people in the world, some of them will be ridiculous. And of
course, the qualitative term "ridiculous" is somewhat subjective. What seems
ridiculous to some may seem reasonable to others. Who should be the arbiter
of what is "truly" ridiculous? This is a Microsoft newsgroup, and Microsoft
is based in the United States. The Founders of the United States felt it
best to allow freedom of speech, and so does Microsoft. It is simpler and
more logical to allow anyone to speak than to try to determine what
qualifies a person to speak. The best part is, you are under no coercion to
agree with, or read any of it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Paranoia is just a state of mind.

"sikander" <si******@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
microsoft really needs an AI software to keep an eye on this newsgroup.
They
listed this discussion under their hot discussions section, and the
discussions are really ridiculous.

"Juan T. Llibre" wrote:
I'm in that mood already, Patrick... ;-)

Juan
====

"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
> hahahahhaa Kevin this one of the funniest thing i read today..
> Thanks for that.
> And Juan lets not waste time with such people in this forum:(
> Patrick
>
>
> "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
> news:eW**************@tk2msftngp13.phx.gbl...
>> 1. You cannot fix something you don't understand. How could you fix,
>> for
>> example, a watch, if you didn't know how it works?
>> 2. An ASP.Net Page is a class. All classes can have methods.
>> 3. Making ASP.Net procedural is a step backwards not a step forwards.
>> 4. ASP.Net was developed over more than 6 years by architects,
>> designers,
>> and programmers who make most of us look like amateurs. What you have
>> done
>> is the equivalent of what Mr. Bean did to the Mona Lisa.
>> 5. If you don't want to learn, stick to ASP.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Paranoia is just a state of mind.
>>
>> "John Rivers" <fi*****@btinternet.com> wrote in message
>> news:11*********************@g47g2000cwa.googlegro ups.com...
>> > This shows you how to implement html rendering methods
>> > and libraries in ASPX pages.
>> >
>> > This also means super fast debugging as no re-initialising
>> > of IIS is required after editting!
>> >
>> > This gets around the ridiculous situation of ASPX pages
>> > not being allowed to have methods.
>> >
>> > I am working on a way to do this with classes as well!
>> >
>> > Here is how to do it:
>> >
>> > you will create two ASPX pages:
>> >
>> > - FixASP.asp (the page that actually gets called)
>> > - Library.asp (the page that provides library methods to FixASP.asp)
>> >
>> > the key thing to note is that we are tricking the ASP.NET compiler
>> > by closing the hidden render method with a brace, then we omit
>> > the last closing brace of our code because ASP.NET will put it in
>> > for
>> > us!
>> >
>> > Contents of FixASP.asp:
>> >
>> > (start)
>> > <%
>> > InitLib(__output, parameterContainer);
>> > PageStart("ASP.NET is sane again!");
>> > PageHeader();
>> > PageMethod();
>> > PageFooter();
>> > PageEnd();
>> > %><!--#Include File="Library.aspx"--><%
>> > }
>> > void PageMethod() {
>> > %>this is the page method<%
>> > %>
>> > (end)
>> >
>> > Contents of Library.asp:
>> >
>> > (start)
>> > <%}
>> > //Don't change this bit
>> > private System.Web.UI.HtmlTextWriter __output;
>> > private System.Web.UI.Control parameterContainer;
>> > void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control
>> > pc)
>> > {
>> > __output = o;
>> > parameterContainer = pc;
>> > }
>> > //Convenience methods go here
>> > string HTML(string data) {
>> > return HttpUtility.HtmlEncode(data);
>> > }
>> > string URL(string data) {
>> > return HttpUtility.UrlEncode(data);
>> > }
>> > string QPX(string name, string val) {
>> > return URL(name) + "=" + URL(val) + "&";
>> > }
>> > //Add your rendering methods here!
>> > void RenderLink(string Title, string URL) {
>> > %><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
>> > }
>> > void PageStart(string Title) {
>> > %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
>> > <html>
>> > <head>
>> > <title><%=HTML(Title)%></title>
>> > </head>
>> > <body><%
>> > }
>> > void PageHeader() {
>> > %><h1>This is the page header</h1><hr/><%
>> > }
>> > void PageFooter() {
>> > %><hr/><h1>This is the page footer</h1><%
>> > }
>> > void PageEnd() {
>> > %></body>
>> > </html><%
>> > }
>> > //Don't change anything after this
>> > void ButtPlug() {
>> > //this is the end
>> > %>
>> > (end)
>> >
>> > now set FixASP.asp as your StartPage
>> > and hit F5
>> >
>>
>>
>
>


Nov 19 '05 #23
re:
The best part is, you are under no coercion to agree with, or read any of it.


....or even reply to it.

;-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eB**************@tk2msftngp13.phx.gbl...
the discussions are really ridiculous.


That blanket statement is not logical. There are some people who post ridiculous things
in this group. However, for the most part, the discussions here are serious Q&A
regarding problems that people have. This is a public newsgroup, and nobody is "locked
out" from posting here. As there are all kinds of people in the world, some of them will
be ridiculous. And of course, the qualitative term "ridiculous" is somewhat subjective.
What seems ridiculous to some may seem reasonable to others. Who should be the arbiter
of what is "truly" ridiculous? This is a Microsoft newsgroup, and Microsoft is based in
the United States. The Founders of the United States felt it best to allow freedom of
speech, and so does Microsoft. It is simpler and more logical to allow anyone to speak
than to try to determine what qualifies a person to speak. The best part is, you are
under no coercion to agree with, or read any of it.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Paranoia is just a state of mind.

"sikander" <si******@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
microsoft really needs an AI software to keep an eye on this newsgroup. They
listed this discussion under their hot discussions section, and the
discussions are really ridiculous.

"Juan T. Llibre" wrote:
I'm in that mood already, Patrick... ;-)

Juan
====

"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
> hahahahhaa Kevin this one of the funniest thing i read today..
> Thanks for that.
> And Juan lets not waste time with such people in this forum:(
> Patrick
>
>
> "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
> news:eW**************@tk2msftngp13.phx.gbl...
>> 1. You cannot fix something you don't understand. How could you fix, for
>> example, a watch, if you didn't know how it works?
>> 2. An ASP.Net Page is a class. All classes can have methods.
>> 3. Making ASP.Net procedural is a step backwards not a step forwards.
>> 4. ASP.Net was developed over more than 6 years by architects, designers,
>> and programmers who make most of us look like amateurs. What you have done
>> is the equivalent of what Mr. Bean did to the Mona Lisa.
>> 5. If you don't want to learn, stick to ASP.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Paranoia is just a state of mind.
>>
>> "John Rivers" <fi*****@btinternet.com> wrote in message
>> news:11*********************@g47g2000cwa.googlegro ups.com...
>> > This shows you how to implement html rendering methods
>> > and libraries in ASPX pages.
>> >
>> > This also means super fast debugging as no re-initialising
>> > of IIS is required after editting!
>> >
>> > This gets around the ridiculous situation of ASPX pages
>> > not being allowed to have methods.
>> >
>> > I am working on a way to do this with classes as well!
>> >
>> > Here is how to do it:
>> >
>> > you will create two ASPX pages:
>> >
>> > - FixASP.asp (the page that actually gets called)
>> > - Library.asp (the page that provides library methods to FixASP.asp)
>> >
>> > the key thing to note is that we are tricking the ASP.NET compiler
>> > by closing the hidden render method with a brace, then we omit
>> > the last closing brace of our code because ASP.NET will put it in for
>> > us!
>> >
>> > Contents of FixASP.asp:
>> >
>> > (start)
>> > <%
>> > InitLib(__output, parameterContainer);
>> > PageStart("ASP.NET is sane again!");
>> > PageHeader();
>> > PageMethod();
>> > PageFooter();
>> > PageEnd();
>> > %><!--#Include File="Library.aspx"--><%
>> > }
>> > void PageMethod() {
>> > %>this is the page method<%
>> > %>
>> > (end)
>> >
>> > Contents of Library.asp:
>> >
>> > (start)
>> > <%}
>> > //Don't change this bit
>> > private System.Web.UI.HtmlTextWriter __output;
>> > private System.Web.UI.Control parameterContainer;
>> > void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
>> > {
>> > __output = o;
>> > parameterContainer = pc;
>> > }
>> > //Convenience methods go here
>> > string HTML(string data) {
>> > return HttpUtility.HtmlEncode(data);
>> > }
>> > string URL(string data) {
>> > return HttpUtility.UrlEncode(data);
>> > }
>> > string QPX(string name, string val) {
>> > return URL(name) + "=" + URL(val) + "&";
>> > }
>> > //Add your rendering methods here!
>> > void RenderLink(string Title, string URL) {
>> > %><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
>> > }
>> > void PageStart(string Title) {
>> > %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
>> > <html>
>> > <head>
>> > <title><%=HTML(Title)%></title>
>> > </head>
>> > <body><%
>> > }
>> > void PageHeader() {
>> > %><h1>This is the page header</h1><hr/><%
>> > }
>> > void PageFooter() {
>> > %><hr/><h1>This is the page footer</h1><%
>> > }
>> > void PageEnd() {
>> > %></body>
>> > </html><%
>> > }
>> > //Don't change anything after this
>> > void ButtPlug() {
>> > //this is the end
>> > %>
>> > (end)
>> >
>> > now set FixASP.asp as your StartPage
>> > and hit F5
>> >
>>
>>
>
>


Nov 19 '05 #24

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
6
by: Marie ALHOMME | last post by:
Hi everybody ! I'm new here, and I'm French, so pardon me for any and all grammar and typo mistakes ! I hope you'll understand everything anyway :) I'm working on my portfolio site, which I...
1
by: Gernot Frisch | last post by:
Hi, I have a fixed point math class, that completely should replace "float" on PocketPC. However the 3D graphics created look a bit odd. I think there's some bug somewhere. Is there any source...
11
by: Linny | last post by:
Hi, I need some help in declaring an array of pointers to array of a certain fixed size. I want the pointers to point to arrays of fixed size only (should not work for variable sized arrays of the...
5
by: Ron Vecchi | last post by:
I know the math I need to perform on width and height to keep an aspect ratio but where and how would I implement keeping a set aspect ratio on a form when a user resizes it. Override OnResize?...
2
by: Brian Henry | last post by:
In C++ you could easily create a fixed with string by creating it with char(50) or so as an example. This made it easy to write data out to a flat file with a fixed width column. What is the best...
8
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I...
2
by: Eric Lindsay | last post by:
Googling suggests that IE7 may support position: fixed; I think this might be handy for some pages I want to do. Does anyone have any comments about whether fixed should be considered for use on...
2
by: dfdavis.mtu | last post by:
I have a table that I dynamically fill with data from a database for medical companies to be able to determine if their patients meet certain criteria. However they want a fixed header for it so...
8
by: ms news group | last post by:
What happens if exception is thown within a fixed block? Will the pinned memory buffer get unpinned? and if the pinning pointer points to a managed memery buffer allocated within the throwing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.