Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 14th, 2005, 12:20 PM
Authorized User
 
Join Date: May 2004
Location: Houston, TX, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to jturlington
Default Putting VBScript in an ASP.NET page

I have been wracking my brain for what seems like DAYS now trying to find a way to do this.

My company uses another companies webmail product to serve our customers email and we need to make a small feature upgrade and the company who created it is asking a price we just don't see as reality because it is maybe 15 lines of code tops(Let's just say it's about $100 a line).

It is ASP.NET files Written in C#. I am an ASP only guy because I am really new to programming.

Is there any way to incorporate some ASP style code into this or could someone covert my code so I can just pop it into the pages. I cannot access the code view of these files.

Here's the code as it would be written in ASP(All I know.):
<%
' This section goes on the login page and only acts when
' it sees the mte querystring. The data querystring is
' a string that will come across like
' "mailto:someguy@someisp.com" minus the quotes.

If Request.Querystring("mte") <> "" then
startOf = InStr(Request.QueryString("data"), ":") + 1
strData = MID(Request.QueryString("data"), startOf)
Session("mte") = Request.QueryString("mte")
Session("data") = strData
end If %>

<%
' This section goes on the first page once they login.
If Session("mte") <> "" then
Response.Redirect("http://www.someisp.com/webmail/newmessage.aspx")
End If %>

<%
' This section goes on the new message editor where a value of TO:
' would go.
If Session("mte") <> "" then
Response.Write(Session("data"))
End If
%>

Any help would be appreciated.

Jon

Thank you,
Jon Turlington
__________________
Thank you,
Jon Turlington
  #2 (permalink)  
Old May 14th, 2005, 09:00 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you cannot access the "code view" of the files how do you expect to be able to add in whatever it is you want to have added in? (I'm not sure what you mean by "code view", do you mean you don't have the component source code?)

If what you intend to do is to add the ASP style code into the ASPX file, you can put almost exactly what you have written write where you want to. The only thing you'll need to do is add an imports statement to the top of the ASPX file so that the visual basic functions you are using are in scope:

<%@ Imports Microsoft.VisualBasic %>

I think that's what you'll need. I use the codebehind model so I'm not used to putting imports statements in my aspx files.

Give that a try.

-Peter
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vbscript in asp.net 2.0 ufdylan ASP.NET 2.0 Basics 3 August 14th, 2007 12:02 PM
Optimization of ASP page with VBScript anandham VBScript 0 April 18th, 2005 05:03 AM
Using quotes in VBSCript and an asp page dragonfields Classic ASP Basics 2 July 31st, 2003 10:30 AM



All times are GMT -4. The time now is 08:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.