473,657 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server-side validation

I posted this yesterday afternoon, but for some reason, I don't see it in my
newsreader, on either of my 2 computers. So I am re-posting.
I'd like to see if there is any guidance in the form of sample code or a
tutorial for server-side validation. Specifically for the thing I am trying
to do, if a user types too many letters into Textarea, then they see an
error on the screen. I was able to catch most occurrences of this error with
client-side javascript. However, I'd like to handle it server-side in order
to catch those cases that get by the javascript for whatever reason. If I
could just catch the error before it gets displayed, then display a warning
in red letters in a pretty format, then that's all I'm hoping to do.

I went to ASPFAQ.com, didn't find anything there. I also did a search of
this forum and didn't see anything. I know conceptually what I want to do,
but I am not sure how to go about it.
Jul 22 '05 #1
4 1400
sTemp = Request.Form("t xtaSomeTextArea ")
If Len(sTemp) > 1000 Then
Response.Redire ct "/?err=1&tmp=" & sTemp
End If

'// Example form
<%
If Request.Queryst ring("err") <> "" Then Response.Write "Error: Too many
characters<br>< br>"
%>
<form action="thispag e.asp" name="frmTemp">
<textarea name="txtaSomeT extArea"><%if len(request.que rystring("tmp") > 0
Then%><%=reques t.querystring(" tmp")%><%end if%></textarea>
<input type="submit" name="btnSubmit ">
</form>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"middletree " <mi********@hto mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP15.phx.gbl...
I posted this yesterday afternoon, but for some reason, I don't see it in my newsreader, on either of my 2 computers. So I am re-posting.
I'd like to see if there is any guidance in the form of sample code or a
tutorial for server-side validation. Specifically for the thing I am trying to do, if a user types too many letters into Textarea, then they see an
error on the screen. I was able to catch most occurrences of this error with client-side javascript. However, I'd like to handle it server-side in order to catch those cases that get by the javascript for whatever reason. If I
could just catch the error before it gets displayed, then display a warning in red letters in a pretty format, then that's all I'm hoping to do.

I went to ASPFAQ.com, didn't find anything there. I also did a search of
this forum and didn't see anything. I know conceptually what I want to do, but I am not sure how to go about it.

Jul 22 '05 #2
OK, this is a good answer. It comes from a completely different direction
from what I was thinking. I was thinking I'd have to come up with code which
read the SQL Server error after it had been generated and displayed my
customer message instead of the SQL/ASP error. Your solution captures the
problem before it gets that far. I like this. I see where it will take some
work to capture all the other parts of the form and put them back into
place, but it will be worth doing.

thanks very much!


"Steven Burn" <so*******@in-time.invalid> wrote in message
news:eg******** *****@TK2MSFTNG P14.phx.gbl...
sTemp = Request.Form("t xtaSomeTextArea ")
If Len(sTemp) > 1000 Then
Response.Redire ct "/?err=1&tmp=" & sTemp
End If

'// Example form
<%
If Request.Queryst ring("err") <> "" Then Response.Write "Error: Too many characters<br>< br>"
%>
<form action="thispag e.asp" name="frmTemp">
<textarea name="txtaSomeT extArea"><%if len(request.que rystring("tmp") > 0
Then%><%=reques t.querystring(" tmp")%><%end if%></textarea>
<input type="submit" name="btnSubmit ">
</form>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"middletree " <mi********@hto mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP15.phx.gbl...
I posted this yesterday afternoon, but for some reason, I don't see it in
my
newsreader, on either of my 2 computers. So I am re-posting.
I'd like to see if there is any guidance in the form of sample code or a
tutorial for server-side validation. Specifically for the thing I am

trying
to do, if a user types too many letters into Textarea, then they see an
error on the screen. I was able to catch most occurrences of this error

with
client-side javascript. However, I'd like to handle it server-side in

order
to catch those cases that get by the javascript for whatever reason. If

I could just catch the error before it gets displayed, then display a

warning
in red letters in a pretty format, then that's all I'm hoping to do.

I went to ASPFAQ.com, didn't find anything there. I also did a search of
this forum and didn't see anything. I know conceptually what I want to

do,
but I am not sure how to go about it.


Jul 22 '05 #3
I was never one for complicating things (brain farts excluded of course
<g>)...

.... and your welcome ;o)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"middletree " <mi********@hto mail.com> wrote in message
news:#Q******** ******@tk2msftn gp13.phx.gbl...
OK, this is a good answer. It comes from a completely different direction
from what I was thinking. I was thinking I'd have to come up with code which read the SQL Server error after it had been generated and displayed my
customer message instead of the SQL/ASP error. Your solution captures the
problem before it gets that far. I like this. I see where it will take some work to capture all the other parts of the form and put them back into
place, but it will be worth doing.

thanks very much!


"Steven Burn" <so*******@in-time.invalid> wrote in message
news:eg******** *****@TK2MSFTNG P14.phx.gbl...
sTemp = Request.Form("t xtaSomeTextArea ")
If Len(sTemp) > 1000 Then
Response.Redire ct "/?err=1&tmp=" & sTemp
End If

'// Example form
<%
If Request.Queryst ring("err") <> "" Then Response.Write "Error: Too many
characters<br>< br>"
%>
<form action="thispag e.asp" name="frmTemp">
<textarea name="txtaSomeT extArea"><%if len(request.que rystring("tmp") > 0
Then%><%=reques t.querystring(" tmp")%><%end if%></textarea>
<input type="submit" name="btnSubmit ">
</form>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"middletree " <mi********@hto mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP15.phx.gbl...
I posted this yesterday afternoon, but for some reason, I don't see it in
my
newsreader, on either of my 2 computers. So I am re-posting.
I'd like to see if there is any guidance in the form of sample code or a tutorial for server-side validation. Specifically for the thing I am

trying
to do, if a user types too many letters into Textarea, then they see an error on the screen. I was able to catch most occurrences of this error with
client-side javascript. However, I'd like to handle it server-side in

order
to catch those cases that get by the javascript for whatever reason.
If I could just catch the error before it gets displayed, then display a

warning
in red letters in a pretty format, then that's all I'm hoping to do.

I went to ASPFAQ.com, didn't find anything there. I also did a search

of this forum and didn't see anything. I know conceptually what I want

to do,
but I am not sure how to go about it.



Jul 22 '05 #4
Gazing into my crystal ball I observed "middletree "
<mi********@hto mail.com> writing in
news:#Q******** ******@tk2msftn gp13.phx.gbl:
OK, this is a good answer. It comes from a completely different
direction from what I was thinking. I was thinking I'd have to come up
with code which read the SQL Server error after it had been generated
and displayed my customer message instead of the SQL/ASP error. Your
solution captures the problem before it gets that far. I like this. I
see where it will take some work to capture all the other parts of the
form and put them back into place, but it will be worth doing.

thanks very much!

You might like some of the stuff at
http://www.intraproducts.com/beta/requiredform.asp , does some other server
side validation and has a good way to display errors to the client.
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:eg******** *****@TK2MSFTNG P14.phx.gbl...
sTemp = Request.Form("t xtaSomeTextArea ")
If Len(sTemp) > 1000 Then
Response.Redire ct "/?err=1&tmp=" & sTemp
End If

'// Example form
<%
If Request.Queryst ring("err") <> "" Then Response.Write "Error:
Too many characters<br>< br>" %>
<form action="thispag e.asp" name="frmTemp">
<textarea name="txtaSomeT extArea"><%if len(request.que rystring("tmp")
> 0 Then%><%=reques t.querystring(" tmp")%><%end if%></textarea>

<input type="submit" name="btnSubmit "> </form>

--
Regards

Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk

Keeping it FREE!

"middletree " <mi********@hto mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP15.phx.gbl...
> I posted this yesterday afternoon, but for some reason, I don't see
> it in my newsreader, on either of my 2 computers. So I am
> re-posting.
>
>
> I'd like to see if there is any guidance in the form of sample code
> or a tutorial for server-side validation. Specifically for the thing
> I am trying to do, if a user types too many letters into Textarea,
> then they see an error on the screen. I was able to catch most
> occurrences of this error with client-side javascript. However, I'd
> like to handle it server-side in order to catch those cases that get
> by the javascript for whatever reason. If I could just catch the
> error before it gets displayed, then display a warning in red
> letters in a pretty format, then that's all I'm hoping to do.
>
> I went to ASPFAQ.com, didn't find anything there. I also did a
> search of this forum and didn't see anything. I know conceptually
> what I want to do, but I am not sure how to go about it.
>
>




--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #5

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

Similar topics

13
2016
by: Fortepianissimo | last post by:
Here is the situation: I want my server started up upon connection. When the first connection comes in, the server is not running. The client realizes the fact, and then starts up the server and tries to connect again. This of course all happens on the same machine (local connection only). The connections can come in as fast as 30+/sec, so the server is threaded (using SocketServer.ThreadingTCPServer). Further, the server initialization...
2
4577
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server" _reg_progid_ = "Python.TestServer" _public_methods_ = _public_attrs_ = _readonly_attrs_ =
1
2623
by: Bennett Haselton | last post by:
I want to get an ASP.Net hosting account with my ISP, and I'm trying to find out what level of access to the server is requried in order for me to view the server in Server Explorer in Visual Studio .Net, where you can see the available database, expand it to get a list of tables, etc. What level of access is required? Of course you need to have an account with the right user rights, but is there some specific service that needs to be...
22
3275
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to load DLL (aspnet_isapi.dll)." Of course the dll is able to be found, it's still in the framework directory and for grins I even put it in my service's local directory. This is apparantly server 2003 not allowing asp.net to be run if IIS was not...
2
4915
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is being updated by some other process through remoting. When the page loads, I init the tree, and in my browser I can see the initialized tree. The problem is that every time that I receive update to tree from the remote process,
4
7296
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always get the same error message: "An error occurred while creating one or more registry entries. Please see C:\WINDOWS\sqlstp.log for details. The problem could be caused by a low registry quota condition" I have tried to clean the registry and i...
10
16206
by: sara | last post by:
Hi All, I was able to connect to MS SQL Server 2005 on my computer but after a while I can not. When I want to connect to it using MS SQL Server Management Studio I got this error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,...
1
3212
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: warning: MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 file /etc/my.cnf from install of MySQL-server-standard-5.0.24a-0.rhel3 conflicts with file from package mysql-3.23.58-1 file...
14
3022
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can anyone please help me with this as I want to install SQL server and also wouold be grateful, if you can suggest me any workaround to dealwith this problem.(Like should I install any new OS etc). Any help would be appreciated.
3
3254
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual Studio 2005 SP1 and had it working perfectly on my Windows XP machine on SQL Server 2005 Express. I decided to publish this application to a test development server (with both the SQL and IIS servers on the same box) running on: Windows Server...
0
8403
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.