Print Page | Close Window

call vb function on button click

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14512
Printed Date: 30 March 2026 at 10:06am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: call vb function on button click
Posted By: riya_singtel
Subject: call vb function on button click
Date Posted: 01 April 2005 at 3:01am
Is there a way i can call a Vb function on buttonclick.
what i am doing is
<Input type="button" value="Remove" OnClick="RCK()">
 
where RCK is written in vbscript as
<%
Function RCK()
    Response.Cookies("nm")=""
End Function
%>
 
using it this way gives an error:
')' Expected
 
I tried "call RCK()" but that too doesnt work
 
Thanks



Replies:
Posted By: MadDog
Date Posted: 01 April 2005 at 3:25am
No you can not do that. Javascript is client side, your Vb function is server side.

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: riya_singtel
Date Posted: 01 April 2005 at 3:36am
So how shd i do it? all i want is that the value of the particular cookie be deleted when i click that button.
if i use a client side vbscript function I have to use document.cookie, but that creates a duplicate cookie though with the same name and no value. what i used was:
 
   <SCRIPT LANGUAGE="VBSCRIPT">
      Sub RemoveCookie
                docu ment.cookie= "nm="
            End Sub
    </SCRIPT>


Posted By: MadDog
Date Posted: 01 April 2005 at 3:38am
If you wanted to use ASP you would just set the cookie = "" then when the browser is closed the cookie is deleted.

With javascript... i have no clue. Try Google.com

Like i like to say when i have no idea, Google is your friend!


-------------
http://www.iportalx.net" rel="nofollow">


Posted By: Mart
Date Posted: 01 April 2005 at 4:27am
<%
If Request.Form("remove") > "" Then
Response.Cookies("nm") = ""
End If
%>

<Input type="button" id="remove" value="Remove">


Posted By: Paul Lush
Date Posted: 01 April 2005 at 9:53am
something like
<script>
function removecookie {
    document.cookie = ''
}
</script>

onlick=removecookie();



Posted By: Mart
Date Posted: 01 April 2005 at 10:05am
That's javascript, he wants server side vbscript


Posted By: Paul Lush
Date Posted: 01 April 2005 at 12:31pm
True, I shouldve read that better.

What Im doing for that is to target a 1x1 pixel IFRAME that has the cookie delete code, that avoids reloading the current page.

<input taget="iframwindow">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net