How to put vb script into a webpage?

cross6

Senior member
Jun 16, 2005
508
0
0
I have a webserver running a working .net IIS - it generates aspx and stuff just fine


I need to make a simple redirect page that created a cookie - their site has an example using VB.

How do I get the server to execute it? - All I get is the code displayed as text?

I put the vb in <code></code> tags in the html.

Is this wrong?

Thanks.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Remember that HTML is purely a markup language. <code> means that a block of text is code and will be formatted to look like code (fixed-width font) by default.

You might need to do something like <script type="text/vbscript"></script> to do what you want, but I have only used JavaScript, not VBscript on webpages..
 

cross6

Senior member
Jun 16, 2005
508
0
0
This is the code the Business Objects says I need to use:



Dim userNane As String = ""
Dim password As String = ""
Dim cmsName As String = system.Environment.MachineName.ToString()
Dim cmsAuth As String = "secWinAD"
Dim MainIdentity As New
CrystalDecisions.Enterprise.WebControls.Identity()

try

MainIdentity.Logon(userName, password, cmsName, cmsAuth)

Dim MyIdentityCookie As New HttpCookie ("MyIdentityCookie", MainIdentity.GetToken ())
MyIdentityCookie.Path= "/"

Response.Cookies.Add(MyIdentityCookie)
Response.Redirect("/businessobjects/enterprise11/InfoView/logon.aspx")

Catch ex As System.Exception

Response.Write(ex.Message.ToString())

Response.End() End Try


I have no clue how I need to get that working on a page. Right now I'm using the <script=vbscript></script> tags and I just get a blank page.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Those looks like stuff you would only execute locally..

Google for 'javascript redirect' for very simple scripts to do what you want
 

cross6

Senior member
Jun 16, 2005
508
0
0
Originally posted by: screw3d
Those looks like stuff you would only execute locally..

Google for 'javascript redirect' for very simple scripts to do what you want



It's much more than a redirect, it's creating a cookie to pass - and it's VB.Net I believe.
 

MajorMullet

Senior member
Jul 29, 2004
816
4
81
You try putting this on the page, around your .NET code? Gotta put <> around the tags of course.

script language="VB" runat="server"

/script

Why not put it in the codebehind though?