jaja
Thu Apr 10 01:15:08 CDT 2008
On 9 =D7=90=D7=A4=D7=A8=D7=99=D7=9C, 18:02, "Bob Barrows [MVP]" <reb01...@NO=
yahoo.SPAMcom>
wrote:
> jaja wrote:
> > Hello all,
> > =C2=A0I am familiar with the HtmlEncode Server method.
>
> > =C2=A0I also read this :
> >
http://msdn2.microsoft.com/en-us/library/a2a4yykt(VS.80).aspx
>
> > =C2=A0My question is: If I want to encode all inputs from user, can I ap=
ply
> > this encoding for all "Input" fields on my site in a single action.
>
> > =C2=A0Something like Input.HtmlEncodeAll() or HtmlEncodeAllInputs() etc.=
>
> Actually, you could write your own function and include it via SSI in
> all your pages:
>
> ProcedureLibrary.asp
> <%
> Sub WriteToResponse(sData, bEncode)
> If bEncode Then
> =C2=A0 =C2=A0 Response.Write Server.HTMLEncode(sData)
> Else
> =C2=A0 =C2=A0 Response.Write sData
> End If
> End Sub
> %>
>
> Then in your html_encode1.asp page:
>
> <!--#include file=3DprocedureLibrary.asp-->
> <%
> dim fname
> fname=3DRequest.Form("txtarea")
> If fname<>"" Then
> =C2=A0 =C2=A0 =C2=A0 WriteToResponse "Hello " & fname, true
> =C2=A0 =C2=A0 =C2=A0 WriteToResponse "!<br />",false
> =C2=A0 =C2=A0 =C2=A0 WriteToResponse "How are you today?", false
> End If
> %>
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
Thank you Bob for the nice tip.
I would have hoped there will we maybe a Server object property which
I will be able to set and it will do the work, but apparently there
isn't.
Thanks, again!