Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2004, 04:12 AM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access page parameters from vbscript

I am having trouble accessing a parameter passed from one apsx page to another from vbscript in the receiving page.

I've simplified my target code right down to focus on the issue of accessing the passed parameter.

I'm not certain if this is an ASPX issue or a vbscript, I confess, I'm a little lost.

Here's the full page, any help appreciated.

------------- Code Begins ----------------
<%@ Page language="c#" Codebehind="TestRequest.aspx.cs" AutoEventWireup="false" Inherits="TestWordWeb.TestRequest" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>TestRequest</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body>
        <form id="TestRequest" method="post">


        You clicked link number <%=Request.QueryString["link"]%>!<BR><BR>
        <A HREF="TestParams.aspx">Try again</A>


        <SCRIPT LANGUAGE="VBScript">
        dim id
        id = 1
        </SCRIPT>


        <SCRIPT LANGUAGE="VBScript">
        dim id2
        '
        id2 = <%=Request.QueryString["link"]%>
        ' <!-- Using Normal brackets causes the following message
        '
        ' <!-- Now how do I use id2 from here ?
        <%=Response.Write(id2)%>
        ' <!-- causes the following error
        ' <!-- Compiler Error Message: CS0103: The name 'id2' does not exist in the class or namespace 'ASP.TestRequest_aspx'
        </SCRIPT>

        </form>
    </body>
</HTML>


J
 
Old September 17th, 2004, 05:20 AM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, well, through persistece and experimentation I've managed to figure out a solution. Although I'm still not certain why the above caused me problems but I was able to devise the following in my target code. This was a method of opening word on the client machine with a given file.
(Intranet scenario with trusted pages etc.)
Still any comments appreciated.

J

-----------------Code Begins----------------------
<%@ Page language="c#" Codebehind="OpenWord.aspx.cs" AutoEventWireup="false" Inherits="JurGUI.OpenWord" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>OpenWord</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body>
        <form id="OpenWord" method="post" runat="server">
            <SCRIPT LANGUAGE="VBScript">
                dim fileName
                fileName = "<%=Request.QueryString["ID"]%>"

                Set objWord = CreateObject("Word.Application")
                objWord.Visible = true

                objWord.Documents.Open fileName
            </SCRIPT>
        </form>
    </body>
</HTML>


J





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBScript to list Textboxes on page Ron Howerton VB How-To 5 October 5th, 2007 08:28 AM
run vbscript from Access Scootterp Access VBA 2 March 24th, 2006 07:02 PM
Optimization of ASP page with VBScript anandham VBScript 0 April 18th, 2005 05:03 AM
Passing parameters from ASP (VBScript) to XSLT rj_mayer Classic ASP XML 5 January 25th, 2005 04:20 PM
Using quotes in VBSCript and an asp page dragonfields Classic ASP Basics 2 July 31st, 2003 10:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.