Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > If statment doesn't work, why ?

Reply
Thread Tools

If statment doesn't work, why ?

 
 
Carlos Fernandes
Guest
Posts: n/a
 
      05-01-2004
Why when i awsner N in my if statment it also inserts data in my db ?

insere.asp

<%
....asp code...
%>
<SCRIPT LANGUAGE=VBScript>
nr=inputbox("S/N." )
if ucase(nr)="S" then
document.write "<%Set RS = Server.CreateObject ("ADODB.Recordset")%>"
document.write "<%RS.Open "reuniao", DB, 1,2 %>"
document.write "<%RS.AddNew%>"
document.write "<%RS ("solicitante") = request.form("solicitante")%>"
document.write "<%RS.Update%>" document.write "<%response.write
"Inserted"%>"
else
window.history.back()
end if
</SCRIPT>
<%
....asp code...
%>

Best regards,

Carlos

http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      05-01-2004
Carlos Fernandes wrote on 01 mei 2004 in
microsoft.public.inetserver.asp.general:

> Why when i awsner N in my if statment it also inserts data in my db ?
>


ASP code is executed serverside BEFORE the page is sent to the client.
The client cannot execute ASP code.

> document.write "<%Set RS = Server.CreateObject ("ADODB.Recordset")%>"


The <% ... %> is executed [serverside, see above], but gives no string in

document.write ""

So it is not a very logical thing to do.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
if statment (assistance) vncntj@hotmail.com ASP .Net 2 01-09-2006 03:20 AM
PIX route inside statment John Cisco 1 09-27-2005 03:06 AM
Using "For Each ctrl In.." Statment Inside UserControl crjunk ASP .Net 2 09-03-2004 06:23 PM
Return statment JL ASP .Net 2 12-17-2003 10:47 AM



Advertisments