2

I have a webpage using ASP.net in c# with a button that runs a VBscript like shown below.

<asp:Button ID="button" runat="server" Text="button" 
OnClientClick="javascript:window.open('filelocation','_blank')" />

In the script I ask the user for information from the webpage they clicked the button on which they normally manually enter or copy and paste.

Is it possible to send these variables from the webpage as parameters to the VBscript file when the button is clicked so they do not have to enter the information, instead it is taken automatically using the parameters?

Thank you!

EDIT: Been looking at this How to call a VBScript file in a C# application? but cannot seem to get it to work also. Any ideas?

Community
  • 1
  • 1
Safinn
  • 622
  • 3
  • 15
  • 26
  • Can we see the full page code and the vbscript code? I'd like to see how you're utilizing your c# code and vbscript code. – Rich Mar 07 '14 at 18:37
  • It is literally a blank page with one button as shown in OP, a label witch shows a number (eg. 4567) and an external .vbs file. I want to pass the number which the label shows into the .vbs script which the button opens when clicked. – Safinn Mar 10 '14 at 07:35

1 Answers1

1

I am just guessing : but is it not possible to edit your VBScript at the server-side (to include your params) according to your needs before sending it to client ?

spetzz
  • 679
  • 8
  • 19
  • The VBs is a file stored on a network drive which I will not be able to edit (i dont think). – Safinn Feb 03 '14 at 08:34
  • 1
    http://forums.aspfree.com/windows-scripting-64/passing-parameters-vbs-html-328499.html – spetzz Feb 03 '14 at 09:44
  • If you won't be able to edit the vbscript then I don't believe you can accomplish your goals. If you can edit it, spetzz is absolutely correct on his approach. – Rich Mar 10 '14 at 15:10