Re: Visual Basic and JavaScript
From: Mikhail Arkhipov (Microsoft) (mikhaila_at_online.microsoft.com)
Date: 09/18/04
- Next message: BrueNET: "Re: Installing VS.net 2003 Trial"
- Previous message: Lau Lei Cheong: "Re: How to move .net from dev to prod?"
- In reply to: Balex: "Visual Basic and JavaScript"
- Next in thread: Balex: "Re: Visual Basic and JavaScript"
- Reply: Balex: "Re: Visual Basic and JavaScript"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: BrueNET: "Re: Installing VS.net 2003 Trial"
- Previous message: Lau Lei Cheong: "Re: How to move .net from dev to prod?"
- In reply to: Balex: "Visual Basic and JavaScript"
- Next in thread: Balex: "Re: Visual Basic and JavaScript"
- Reply: Balex: "Re: Visual Basic and JavaScript"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|