ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 9th, 2003, 10:09 AM
Melodia Melodia is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Lebanon
Posts: 3 Melodia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using procedures in ASP

Please be patient guys, I am new to ASP programming but I assure you that I am a fast learner.

Ok, If I need to use a procedure call when clicking on a form button of an "ASP" page instead of submitting the form.

<Input type="Button" name="btnInsert" value="Insert" OnClick="btnInsert_Click()">

<%
Sub btnInsert_Click()
' I need to open a table and insert the data I collected in a form
EndSub
%>

When clicking I received an error "Object Expected". What is wrong in the code.

Should I inclose the btnInsert_Click() within the <Script> tag?

Thanks


Thanks

Reply With Quote
  #2  
Old November 10th, 2003, 08:52 AM
DarrellMe DarrellMe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Birmingham, England
Posts: 7 DarrellMe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There are two forms of functions/subroutines. Server side, which is normally used with VBScript, and client side, which is normally used with Javascript.

When using the onClick property of a HTML tag, you are trying to activate a client side function, and therefore needs to be defined between the <script> tags. You can also use VBScript as a client side scripting, however, this only works with IE and not other browsers.

The better method of achieving what you want is to have the action of the form post to another asp page. This asp web page retrieves the fields passed to it, and then updates the database table.

I hope this helps

Darrell

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Using procedures in ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT