I'm trying to call a vb function in an asp page. I'm using the
following code:

<table>
<tr>
<td valign="top" width="200" align="left">
<%
Response.Write "<input type='image' src='images/header_collapsed.jpg'
onClick='ShowAspLog'>"
%>
<font size=2 color="0000FF">ASP Log </font>
</td>
</tr>
</table>

The Function is:
<%
Function ShowAspLog
Response.Write "<table>"
Response.Write "<tr>"
Response.Write "<td>"
Response.Write "<td valign=top>" & getSQLTable("SELECT date as Date,
action as Action, comment as Comment FROM RPSSAspLog WHERE client = " &
Request.QueryString("client") & " and (date > GETDATE() - 180) ORDER
BY date DESC") & "</td>"
Response.Write "<td width=20></td>"
Response.Write "</td>"
Response.Write "</tr>"
Response.Write "</table>"
End Function
%>

The image is displayed but when I click it I get an error on the page.
Any ideas?

Re: VBScript calling a function with onclick by Anthony

Anthony
Fri Jan 26 16:36:31 CST 2007


"SomeASP" <christy.grecian@payless.com> wrote in message
news:1169832692.480310.296120@j27g2000cwj.googlegroups.com...
> I'm trying to call a vb function in an asp page. I'm using the
> following code:
>
> <table>
> <tr>
> <td valign="top" width="200" align="left">
> <%
> Response.Write "<input type='image' src='images/header_collapsed.jpg'
> onClick='ShowAspLog'>"
> %>
> <font size=2 color="0000FF">ASP Log </font>
> </td>
> </tr>
> </table>
>
> The Function is:
> <%
> Function ShowAspLog
> Response.Write "<table>"
> Response.Write "<tr>"
> Response.Write "<td>"
> Response.Write "<td valign=top>" & getSQLTable("SELECT date as Date,
> action as Action, comment as Comment FROM RPSSAspLog WHERE client = " &
> Request.QueryString("client") & " and (date > GETDATE() - 180) ORDER
> BY date DESC") & "</td>"
> Response.Write "<td width=20></td>"
> Response.Write "</td>"
> Response.Write "</tr>"
> Response.Write "</table>"
> End Function
> %>
>
> The image is displayed but when I click it I get an error on the page.
> Any ideas?
>

The browser is ending up with HTMl like this:-

<table>
<tr>
<td valign="top" width="200" align="left">
<input type='image' src='images/header_collapsed.jpg'
onClick='ShowAspLog'>
<font size=2 color="0000FF">ASP Log </font>
</td>
</tr>
</table>

When input is clicked the browser will attempt to access the ShowAspLog
identifier but that doesn't exist in the content sent to the browser.

All code between <% %> is executed on the server, as it does calls to
Response.Write etc causes data to be sent to the client.

The client browser is complete oblivious to how the content was generated
and is unable to access any functions that may have existed during the
creation of the content on a remote server.




Re: VBScript calling a function with onclick by SomeASP

SomeASP
Fri Jan 26 17:08:04 CST 2007

Thanks for replying Anthony

I changed the code to:

<table>
<tr>
<td valign="top" width="200" align="left">
<input type='image' src='images/header_collapsed.jpg'
onClick='ShowAspLog'>
<font size=2 color="0000FF">ASP Log </font>
</td>
</tr>
</table>

but I still get an error. Do I need to change something in the
Function?


On Jan 26, 4:36 pm, "Anthony Jones" <A...@yadayadayada.com> wrote:
> "SomeASP" <christy.grec...@payless.com> wrote in messagenews:1169832692.480310.296120@j27g2000cwj.googlegroups.com...
>
>
>
>
>
> > I'm trying to call a vb function in an asp page. I'm using the
> > following code:
>
> > <table>
> > <tr>
> > <td valign="top" width="200" align="left">
> > <%
> > Response.Write "<input type='image' src='images/header_collapsed.jpg'
> >onClick='ShowAspLog'>"
> > %>
> > <font size=2 color="0000FF">ASP Log </font>
> > </td>
> > </tr>
> > </table>
>
> > The Function is:
> > <%
> > Function ShowAspLog
> > Response.Write "<table>"
> > Response.Write "<tr>"
> > Response.Write "<td>"
> > Response.Write "<td valign=top>" & getSQLTable("SELECT date as Date,
> > action as Action, comment as Comment FROM RPSSAspLog WHERE client = " &
> > Request.QueryString("client") & " and (date > GETDATE() - 180) ORDER
> > BY date DESC") & "</td>"
> > Response.Write "<td width=20></td>"
> > Response.Write "</td>"
> > Response.Write "</tr>"
> > Response.Write "</table>"
> > End Function
> > %>
>
> > The image is displayed but when I click it I get an error on the page.
> > Any ideas?The browser is ending up with HTMl like this:-
>
> <table>
> <tr>
> <td valign="top" width="200" align="left">
> <input type='image' src='images/header_collapsed.jpg'onClick='ShowAspLog'>
> <font size=2 color="0000FF">ASP Log </font>
> </td>
> </tr>
> </table>
>
> When input is clicked the browser will attempt to access the ShowAspLog
> identifier but that doesn't exist in the content sent to the browser.
>
> All code between <% %> is executed on the server, as it does calls to
> Response.Write etc causes data to be sent to the client.
>
> The client browser is complete oblivious to how the content was generated
> and is unable to access any functions that may have existed during the
> creation of the content on a remote server.- Hide quoted text -- Show quoted text -


Re: VBScript calling a function with onclick by Shiva

Shiva
Sat Jan 27 01:42:16 CST 2007

To call Input in a asp file it has to be in a form:
<form>
<input type='image' src='images/header_collapsed.jpg'
onClick='ShowAspLog'>
</form>

If it is still not calling your ShowAspLog Fuction use following code:
<form>
<input name='header' type='image' src='images/header_collapsed.jpg'
onClick='ShowAspLog'>
</form>

<%
If Len(Request.Form("header"))>0 Then
call ShowAspLog
End If
%>

Hope this helps

On 27 Jan., 03:08, "SomeASP" <christy.grec...@payless.com> wrote:
> Thanks for replying Anthony
>
> I changed the code to:
>
> <table>
> <tr>
> <td valign="top" width="200" align="left">
> <input type='image' src='images/header_collapsed.jpg'
> onClick='ShowAspLog'>
> <font size=2 color="0000FF">ASP Log </font>
> </td>
> </tr>
> </table>
>
> but I still get an error. Do I need to change something in the
> Function?
>
> On Jan 26, 4:36 pm, "Anthony Jones" <A...@yadayadayada.com> wrote:
>
>
>
> > "SomeASP" <christy.grec...@payless.com> wrote in messagenews:1169832692.480310.296120@j27g2000cwj.googlegroups.com...
>
> > > I'm trying to call a vb function in an asp page. I'm using the
> > > following code:
>
> > > <table>
> > > <tr>
> > > <td valign="top" width="200" align="left">
> > > <%
> > > Response.Write "<input type='image' src='images/header_collapsed.jpg'
> > >onClick='ShowAspLog'>"
> > > %>
> > > <font size=2 color="0000FF">ASP Log </font>
> > > </td>
> > > </tr>
> > > </table>
>
> > > The Function is:
> > > <%
> > > Function ShowAspLog
> > > Response.Write "<table>"
> > > Response.Write "<tr>"
> > > Response.Write "<td>"
> > > Response.Write "<td valign=top>" & getSQLTable("SELECT date as Date,
> > > action as Action, comment as Comment FROM RPSSAspLog WHERE client = " &
> > > Request.QueryString("client") & " and (date > GETDATE() - 180) ORDER
> > > BY date DESC") & "</td>"
> > > Response.Write "<td width=20></td>"
> > > Response.Write "</td>"
> > > Response.Write "</tr>"
> > > Response.Write "</table>"
> > > End Function
> > > %>
>
> > > The image is displayed but when I click it I get an error on the page.
> > > Any ideas?The browser is ending up with HTMl like this:-
>
> > <table>
> > <tr>
> > <td valign="top" width="200" align="left">
> > <input type='image' src='images/header_collapsed.jpg'onClick='ShowAspLog'>
> > <font size=2 color="0000FF">ASP Log </font>
> > </td>
> > </tr>
> > </table>
>
> > When input is clicked the browser will attempt to access the ShowAspLog
> > identifier but that doesn't exist in the content sent to the browser.
>
> > All code between <% %> is executed on the server, as it does calls to
> > Response.Write etc causes data to be sent to the client.
>
> > The client browser is complete oblivious to how the content was generated
> > and is unable to access any functions that may have existed during the
> > creation of the content on a remote server.- Hide quoted text -- Show quoted text -- Zitierten Text ausblenden -- Zitierten Text anzeigen -