Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB not working on ASP Page

Status
Not open for further replies.

jortego

Programmer
Oct 14, 2002
16
0
0
US
I developed an ASP application to be part of an Intranet run from a IIS server. It runs perfectly on the computer I developed it on, however when I install it on the client's IIS server, the Visual Basic Code doesn't seam to be recognized.

My pages are .asp and the client already has .asp pages running on the same server. They, however, are only using javascript and not VB.

I am fairly new to IIS as well as ASP pages. I did compare their server configuration to my development one and they appear to be the same. Does anyone have any advice of things that I should check or look for to help figure out how to make my code work?
 
I'll assume you created the pages in VS6 or similar where you have compiled the code. Unless you are using ASP.NET this will not work right. You need to use vbscript for the older version of ASP, due to ASP not being compiled in the same respect to working with VB and or ASP.NET. ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }

 
Make sure you put this at the top of every asp page so that it knows it's written in vbscript:

<%@language=vbscript%> -----------------------------------------------------------------
&quot;C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.&quot;
- Bjarne Stroustrup

mikewolf@tst-us.com
 
I'm confused. Are we talking about VB here, or VBScript, or what?

Compiled VB6 components work in about every version of ASP since 2.0 at least (IIS 4). .Net has nothing to do with it. Look at Web Classes in VB6 for example, where you develop the whole thing in VB6. This is where the .Net people got the idea for .Net Web Forms from. Of course the components have to be installed on the server, you can't just copy the DLLs or OCXs over there.

Wow. Amazing, scary, and bold to find anybody using lots of server-side Javascript. It tends to be confusing with both the client-side and server-side code in the same text file and in the same language, instructional materials and documentation in general are sparse on server-side Javascript, and I don't think many people do it. Works just fine though.
 
.NET was a reference to writing a complete ASP page in VB (VB.NET). Not referencing or saying VB has no use in ASP. You can't write a complete page in VB as you would with vbscript (excluding web classes)! That is what it sounded to me like they were trying to do. If you did write a page in VB and ran it in VS it would appear to work and would appear to be fine, UNTIL you placed it on the server and then got nothing. ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Thanks for the quick responses.

Here are some clarifications just to make sure that I am following along.

The page I wrote is an ASP page that uses Visual Basic(With the <% %> markers), HTML and some minor Javascript for data validation. These were written in Microsoft Development Environment 2002. They work on the Development Server but not on the Client's Server. We are both running the same version on IIS.

The client has existing pages with Javascript and HTML which seem to work fine. I do no know where these were developed.

It sounds like what I need to do is put the &quot;<%@language=vbscript%> &quot; line in. Anything else?

Thanks
 
Visual Basic and VBScript have differences in the syntax. just a wrning that only the declaration of the language is not enough. besides that fact ASP defaults to vbscript so that should not make abit of difference. Besides it sounds like the javascript is entirerly client side anyways

the conversion to vbscript is not major and you shouldn't have any problems ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
oppnt - I'm guessing that since the current site uses javascript (I read server-side jscript) that they may have changed the default scripting language in IIS to javascript. If that is the case, then my solution is what is necessary.... -----------------------------------------------------------------
&quot;C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.&quot;
- Bjarne Stroustrup

mikewolf@tst-us.com
 
see what happens when you don't re-read the original post.
[smile]

it just never seemed entirely clear what was what. but I got it ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
What was that about coffee and sleep? ;) --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
No more vacation for me :(

FAQ FAQ20-2863
= new Forums.Posting.General.GettingAnswers()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top