Re: Visual Basic and JavaScript

From: Mikhail Arkhipov (Microsoft) (mikhaila_at_online.microsoft.com)
Date: 09/18/04


Date: Fri, 17 Sep 2004 22:37:55 -0700

Response is server-side object and judging from the code snippet you place
it in client script blocks. Try adding runat=server to the script block or
use <% %> ASP expressions.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.

On 9/17/04 8:17, in article
30A54EE7-F1B0-4CD9-AD14-D305E1271C92@microsoft.com, "Balex"
<Balex@discussions.microsoft.com> wrote:

> Hi wise guys,
>
> I have taken up VB again after years of interruption, where I developed with
> other tools, including recently Dreamweaver (DW). With DW, I did a prototype
> of an app, using ASP, Javascript and Access, that had quite a bit of
> Javascript code.
>
> After having received, installed and tried out VSnet with a walkthrough, I
> decided to do a small portion of my DW app in VB, as a web form. The part of
> accessing the DB (SQLServer) went well, so I decided to take it a step
> further and to add a small script which I had in the DW app to a cell of a
> table in VB. That did NOT work, regardless of how I tried. Here is the
> current code snippet (part of the HTML code of the Web form), which at least
> doesn't produce any compile error, but just an exec error on which I can
> continue:
>
> <TR>
> <TD style="WIDTH: 45px; HEIGHT: 23px"><FONT size="2">Datum/Zeit:</FONT></TD>
> <TD style="HEIGHT: 23px">
> <script language="javascript">
> var jetzt = new Date(); Response.
> Response.Write(jetzt.getDate() + "." + (jetzt.getMonth() + 1) + "." +
> jetzt.getYear() + " " + jetzt.getHours() + ":" + jetzt.getMinutes());
> </script>
> </TD>
> </TR>
>
> The error I get is that 'Response' is not defined...
>
> Pretty simple actually, I just want to print the current date and time in
> that cell. In DW, this is a server-side script. I guess it's of course
> possible with VB to achieve the same (current date/time in a table cell) in a
> different way, but it is NOT what I want to achieve: I have LOADS of scripts
> in my DW app, and I would like to know how much of these I ca "import" in the
> VB app, and how much I have to modify them.
>
> So I'd like to know:
> - why is the Javascript not working
> - what do I have to do to make it work
> - how much of my DW scripts can I re-use.
>
> Thanks a lot for your help to a VSnet/VB newbie.
>
> Balex
>



Relevant Pages

  • RE: Streaming javascript and XP Service Pack 2
    ... Thanks for your posting. ... tests based on your description and the code snippet you provided. ... it seems that the script can run correctly on my side. ... #Scripts may not run on a local HTML Web page that references .htc or .xml ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Using VBScript to send message using CDO.message
    ... I found this code snippet, which is similar to Vlad's idea, ... Set cdoMessage = CreateObject ... I used the stock script from the Script Center ... > Windows 2003 server and it won't. ...
    (microsoft.public.scripting.vbscript)
  • Re: "End Of Line" Confusion
    ... If you email the script to me, I'd be happy to take a look at it and ... possible source of such mysterious errors in Python, apparently, is ... mixing tabs and spaces in your indentation. ... which could explain why the code snippet ...
    (comp.lang.python)
  • Re: Weird incrementing problem
    ... But why would the code snippet I posted earlier, ... > If I may take a wild guess, the script is somehow invoked twice. ... > checked whether there is only a single connection to your webserver ...
    (comp.lang.php)
  • Re: Creating Secure Standalone Binaries for 9/X
    ... I can't figure out how to lock down the app ... so the IP of the script is unprotected. ... does is copy the text of your script into the resource: ... Of course, as Andreas said, it's probably just a matter that the file type ...
    (comp.lang.tcl)