473,803 Members | 2,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert ASP to JavaScript and run from CD

Hi

I have some ASP code that I want to run from CD within a VB.NET windows
application with a web browser control.

However, to get the ASP pages to run without a server is proving quite
difficult. I was thinking of converting the pages to use JavaScript but I
know virtually no JavaScript and just wanted to check if what I want to
achieve is possible before making any changes.

The pages make up a portfolio that I plan to put onto CD. It consists of a
series of pages with thumbnails. A thumbnail will either link off to
another page with thumbnails, display an image or play a movie.

I am mainly using loops to display the thumbnails and build up a URL to link
off to the apprioparte image. I have attached my main page at the bottom of
this post that uses the query string to build the page.
The page is linked to using URLs as follows:
<A href="ShowImage .asp?g=2&sg=1&s gmax=2&i=0&imax 1=28&imax2=28">
<A href="ShowImage .asp?g=3&sg=1&s gmax=2&i=0&imax 1=28&imax2=28">
<A href="ShowImage .asp?g=4&sg=1&s gmax=1&i=0&imax 1=14&imax2=0">

These state the group number, then the sub group number, then how many sub
groups there are, next the image number and then the number of images in
each sub group.
The main page then test the image number. If its zero then it will show
thumbnails, if its greater than zero it will show the appropriate image.
There is also some additional code to show/hide next and previous buttons to
allow the user to navigate through the images.

So I would like to know if a similar thing is possible with JavaScript and
if I will be able to get the pages to run from CD within a Windows app with
a web browser control. Also any help on how to actually convert the code
would be greatly appreciated.

Regards, Carl Gilbert

--------------------------------------
CODE --------------------------------------
<%

spacer = "images\misc\sp acer.gif"
filler = "images\misc\fi ller.gif"
line_end = "images\misc\li ne_end.gif"
btn_previous = "images\misc\pr evious.gif"
btn_next = "images\misc\ne xt.gif"
btn_contents = "images\misc\co ntents.gif"
btn_summary = "images\misc\su mmary.gif"
int_g = request.QuerySt ring("g")
int_sg = request.QuerySt ring("sg")
int_sgmax = request.QuerySt ring("sgmax")
int_i = request.QuerySt ring("i")
int_imax1 = request.QuerySt ring("imax1")
int_imax2 = request.QuerySt ring("imax2")

int_g = CInt(int_g)
int_sg = CInt(int_sg)
int_sgmax = CInt(int_sgmax)
int_i = CInt(int_i)
int_imax1 = CInt(int_imax1)
int_imax2 = CInt(int_imax2)

'set the max number of images based on the sub group
If int_sg = 1 Then
int_mymax = int_imax1
Else
int_mymax = int_imax2
End If

'b1 = previous
'b2 = next
'b3 = contents
'b4 = summary

If int_i = 0 Then
'we are dealing with a group

'set the previous button
If int_sg > 1 Then b1 = 80 Else b1 = 0

'set the next button
If Not int_sg = int_sgmax Then s1 = 10 Else s1 = 0
If Not int_sg = int_sgmax Then b2 = 80 Else b2 = 0

Else
'We are dealing with an image

'set the previous button
If int_i > 1 Then b1 = 80 Else b1 = 0

'set the next button
If Not int_i = int_mymax Then s1 = 10 Else s1 = 0
If Not int_i = int_mymax Then b2 = 80 Else b2 = 0

End If

'set the contents button
If Not int_i = 0 Then s2 = 10 Else s2 = 0
If Not int_i = 0 Then b3 = 80 Else b3 = 0

'set the summary button
If Not int_g = 0 Then s3 = 10 Else s3 = 0
If Not int_g = 0 Then b4 = 80 Else b4 = 0

h1 = 620 - (b1+s1+b2+s2+b3 +s3+b4)

%>

<HTML>
<HEAD>
<TITLE>ShowImag e</TITLE>
<META name="GENERATOR " content="Micros oft Visual Studio .NET 7.1">
<META name="CODE_LANG UAGE" content="Visual Basic .NET 7.1">
<META name=vs_default ClientScript content="JavaSc ript">
<META name=vs_targetS chema
content="http://schemas.microso ft.com/intellisense/ie3-2nav3-0">
</HEAD>
<BODY ms_positioning= "FlowLayout ">

<FORM id="Form1" method="post" runat="server">
<TABLE width="100%" height="100%" border="0" cellspacing="0"
cellpadding="0" id="Table1">
<TR>
<TD>
<% If int_i = 0 Then %>

<TABLE width="800" height="533" border="0" align="center"
cellpadding="0" cellspacing="0" id="Table2" STYLE="border: 2 ridge
#800000">

<% Else %>

<TABLE width="800" height="533" border="0" align="center"
cellpadding="0" cellspacing="0" id="Table3" STYLE="backgrou nd-image:
url(images\bulk \g<%=int_g%>sg< %=int_sg%>i<%=i nt_i%>.jpg); border: 2 ridge
#800000">

<% End If %>
<TR>
<TD><IMG src="<%=spacer% >" height="61" width="90"></TD>
<TD valign=bottom>
<IMG src="images\mis c\port.gif" height="25" width="130">
</TD>
</TD>
<TD><IMG src="<%=spacer% >" height="61" width="90"></TD>
</TR>

<!-- DIVIDER LINE -->
<TR>
<TD height="1"></TD>
<TD><TABLE border="0" cellpadding="0" cellspacing="0" height="1">
<TR>
<TD height="1"><IMG src="<%=line_en d%>" height="5" width="1"></TD>
<TD height="1"><IMG src="<%=filler% >" height="5" width="618"></TD>
<TD height="1"><IMG src="<%=line_en d%>" height="5" width="1"></TD>
</TR>
</TABLE></TD>
<TD height="1"></TD>
</TR>

<!-- BUTTON ROW -->

<TR>
<TD><IMG src="<%=spacer% >" height="56" width="90"></TD>
<TD><TABLE width="620" height="56" border="0" cellpadding="0"
cellspacing="0" >
<TD valign=top width=<%=h1%>>
<SPAN style='font-size:14.0pt;fon t-family:"Courier New"'>

<%If int_g = 1 Then %>
modelmaking
<%Else%>
artwork
<%End If%>

<I>#<%=int_sg%> </I>

</SPAN>
</TD>

<!-- PREVIOUS -------------------------------------------->
<TD valign=middle>
<% If Not Clng(b1)=0 Then%>

<% If int_i = 0 Then
'Test to see if we are showing images or thumbs to put the correct
link in the button
%>
<A href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_s g -
1%>&sgmax=<%=in t_sgmax%>&i=0&i max1=<%=int_ima x1%>&imax2=<%=i nt_imax2%>">
<!--Thumb link-->
<IMG src="<%=btn_pre vious%>" height="30" width="80" border="0">
</A>
<% Else %>
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=<%=i nt_i
- 1%>&imax1=<%=in t_imax1%>&imax2 =<%=int_imax2%> "> <!--Image link-->
<IMG src="<%=btn_pre vious%>" height="30" width="80" border="0">
</A>
<%End If %>

<%End If%>
</TD>

<% If Not Clng(s1)=0 Then%>
<TD><IMG src="<%=spacer% >" height="30" width="10"></TD>
<%End If%>

<!-- NEXT -------------------------------------------->
<TD valign=middle>
<% If Not Clng(b2)=0 Then%>

<% If int_i = 0 Then
'Test to see if we are showing images or thumbs to put the correct
link in the button
%>
<A href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_s g +
1%>&sgmax=<%=in t_sgmax%>&i=0&i max1=<%=int_ima x1%>&imax2=<%=i nt_imax2%>">
<!--Thumb link-->
<IMG src="<%=btn_nex t%>" height="30" width="80" border="0">
</A>
<% Else %>
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=<%=i nt_i
+ 1%>&imax1=<%=in t_imax1%>&imax2 =<%=int_imax2%> "> <!--Image link-->
<IMG src="<%=btn_nex t%>" height="30" width="80" border="0">
</A>
<%End If %>

<%End If%>
</TD>

<% If Not Clng(s2)=0 Then%>
<TD><IMG src="<%=spacer% >" height="30" width="10"></TD>
<%End If%>

<!-- CONTENTS -------------------------------------------->
<TD valign=middle>
<% If Not Clng(b3)=0 Then%>
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=0&im ax1=<%=int_imax 1%>&imax2=<%=in t_imax2%>">
<IMG src="<%=btn_con tents%>" height="30" width="80" border="0">
</A>
<%End If%>
</TD>

<% If Not Clng(s3)=0 Then%>
<TD><IMG src="<%=spacer% >" height="30" width="10"></TD>
<%End If%>

<!-- SUMMARY -------------------------------------------->
<TD valign=middle>
<% If Not Clng(b4)=0 Then%>
<A href="summarypa ge.asp">
<IMG src="<%=btn_sum mary%>" height="30" width="80" border="0">
</A>
<%End If%>
</TD>
</TABLE>

</TD>

<TD><IMG src="<%=spacer% >" height="56" width="90"></TD>
</TR>

<TR>
<TD><IMG src="<%=spacer% >" height="350" width="90"></TD>
<TD>
<% 'Test if int_i = 0. If so then show the thumbnails
If int_i = 0 Then %>

<!--CONTENT TABLE-->
<TABLE width="620" border="0" cellpadding="0" cellspacing="0"
id="Table4">
<TR>

<% For x = 1 To 7
If x <= int_mymax Then %>
<TD width="80" height="80">
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=<%=x %>&imax1=<%=int _imax1%>&imax2= <%=int_imax2%>" >
<IMG src="images\thu mbs\th_g<%=int_ g%>sg<%=int_sg% >i<%=x%>.jpg"
width="100%" height="100%" border="0">
</A>
</TD>
<% Else %>
<TD width="80" height="80"><IM G src="<%=spacer% >" width="100%"
height="100%" border="0"></TD>
<% End If %>
<% If Not x = 7 Then %>
<TD width="10"><IMG src="<%=spacer% >" width="10"></TD>
<% End If %>
<% Next %>

</TR>
<TR><TD height="10"><IM G src="<%=spacer% >" height="10"></TD></TR>
<TR>

<% For x = 8 To 14
If x <= int_mymax Then %>
<TD width="80" height="80">
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=<%=x %>&imax1=<%=int _imax1%>&imax2= <%=int_imax2%>" >
<IMG src="images\thu mbs\th_g<%=int_ g%>sg<%=int_sg% >i<%=x%>.jpg"
width="100%" height="100%" border="0">
</A>
</TD>
<% Else %>
<TD width="80" height="80"><IM G src="<%=spacer% >" width="100%"
height="100%" border="0"></TD>
<% End If %>
<% If Not x = 14 Then %>
<TD width="10"><IMG src="<%=spacer% >" width="10"></TD>
<% End If %>
<% Next %>

</TR>
<TR>
<TD height="10"><IM G src="<%=spacer% >" height="10"></TD>
</TR>
<TR>

<% For x = 15 To 21
If x <= int_mymax Then %>
<TD width="80" height="80">
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=<%=x %>&imax1=<%=int _imax1%>&imax2= <%=int_imax2%>" >
<IMG src="images\thu mbs\th_g<%=int_ g%>sg<%=int_sg% >i<%=x%>.jpg"
width="100%" height="100%" border="0">
</A>
</TD>
<% Else %>
<TD width="80" height="80"><IM G src="<%=spacer% >" width="100%"
height="100%" border="0"></TD>
<% End If %>
<% If Not x = 21 Then %>
<TD width="10"><IMG src="<%=spacer% >" width="10"></TD>
<% End If %>
<% Next %>

</TR>
<TR>
<TD height="10"><IM G src="<%=spacer% >" height="10"></TD>
</TR>
<TR>

<% For x = 22 To 28
If x <= int_mymax Then %>
<TD width="80" height="80">
<A
href="ShowImage .asp?g=<%=int_g %>&sg=<%=int_sg %>&sgmax=<%=int _sgmax%>&i=<%=x %>&imax1=<%=int _imax1%>&imax2= <%=int_imax2%>" >
<IMG src="images\thu mbs\th_g<%=int_ g%>sg<%=int_sg% >i<%=x%>.jpg"
width="100%" height="100%" border="0">
</A>
</TD>
<% Else %>
<TD width="80" height="80"><IM G src="<%=spacer% >" width="100%"
height="100%" border="0"></TD>
<% End If %>
<% If Not x = 28 Then %>
<TD width="10"><IMG src="<%=spacer% >" width="10"></TD>
<% End If %>
<% Next %>

</TD>
</TR>

</TABLE>

<% End If %>


</TD>
<TD><IMG src="<%=spacer% >" height="350" width="90"></TD>
</TR>

<TR>
<TD><IMG src="<%=spacer% >" height="61" width="90"></TD>
<TD><IMG src="<%=spacer% >" height="61" width="620"></TD>
<TD><IMG src="<%=spacer% >" height="61" width="90"></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

</FORM>
</BODY>
</HTML>

Jul 23 '05 #1
5 2240
you may want to look at creating 'hta' applications.
look here for more info
http://members.aol.com/nickjc67/weblicat.htm


Jul 23 '05 #2
>> you may want to look at creating 'hta' applications.
look here for more info
http://members.aol.com/nickjc67/weblicat.htm


From what I can gather, this only allows you to place code at the
beginning of the script. Are you able to place code anywhere in the
document as with ASP? The same question applies to JavaScript.

*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #3
In article <1f************ @news.uswest.ne t>, mr************* @hotmail.com
enlightened us with...
you may want to look at creating 'hta' applications.
look here for more info
http://members.aol.com/nickjc67/weblicat.htm


From what I can gather, this only allows you to place code at the
beginning of the script. Are you able to place code anywhere in the
document as with ASP? The same question applies to JavaScript.


Using an HTA, yes, you can place code anywhere in the document, just like
ASP. It looks very similar to an ASP application, actually.

--
--
~kaeli~
Synonym: the word you use in place of a word you can't
spell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
Carl Gilbert wrote:
you may want to look at creating 'hta' applications.
look here for more info
http://members.aol.com/nickjc67/weblicat.htm

From what I can gather, this only allows you to place code at the
beginning of the script. Are you able to place code anywhere in the
document as with ASP? The same question applies to JavaScript.


Yes, but note that the result will only run on Windows with IE.
--
Fred
Jul 23 '05 #5

"Carl Gilbert" <mr************ *@hotmail.com> wrote in message
news:1f******** ****@news.uswes t.net...
you may want to look at creating 'hta' applications.
look here for more info
http://members.aol.com/nickjc67/weblicat.htm


From what I can gather, this only allows you to place code at the
beginning of the script. Are you able to place code anywhere in the
document as with ASP? The same question applies to JavaScript.


It only works with Windows IE.
Work thru the tutorial - you'll see how it works.
Its similar to ASP. Yes, you can include JS.
If you don't like it,
then Mr Gates will be heart-broken.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
18039
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript function and have JS put this into an array. Then JS would use this array to create a selection list which displays only the names of the drugs. When the user selections one of the drugs, another selection list will be loaded with the avaiable...
4
5395
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
9
36840
by: mprocopio | last post by:
Fellow JavaScripters, I am looking for code or implementation ideas for converting an integer variable to a four-byte array. I'm porting some of my code from C#, where I make use of their BitConverter utility class, but am still feeling my way around a bit here with JavaScript. The idea is that each of the four bytes that comprise an integer (I presume numeric types in JavaScript are/can be made four bytes?) are extracted, and then...
4
4293
by: CSharpener | last post by:
This should be *so* easy! How do I convert a Byte or int to a binary string representation in C# In JavaScript, it goes like this for an int: javascript:(123).toString(2 or javascript:(0xFE).toString(2 No problem. So, how do I do the same in C#? What simple thing am I missing
3
63110
by: rishabhshrivastava | last post by:
Hello All, How can I convert a value to Double in JavaScript??? In vbscript i believe its done as cDbl(Value) I tried lots of way but getting a value of "NaN". Any suggestions/ideas will be truely appreciated.
3
12277
by: vunet.us | last post by:
What is the best method to convert milliseconds (after midnight January 1, 1970 GMT) to formatted time example: 972798180000 ==10/18/2000 14:08:11
1
442
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number? ----------------------------------------------------------------------- Javascript variables are loosely typed: the conversion between a string and a number happens automatically. Since plus (+) is also used as in string concatenation, ` '1' + 1 ` is equal to ` '11' `: the String deciding...
2
2233
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number? ----------------------------------------------------------------------- Javascript variables are loosely typed: the conversion between a string and a number happens automatically. Since plus (+) is also used as in string concatenation, ` '1' + 1 ` is equal to ` '11' `: the String deciding...
9
2585
by: _Who | last post by:
I have a .htm file that shows in an iframe which is part of a master's asp:Content. I need the .htm to copy the style class from the master or set it as shown below. Below is how I set the stylesheet in the master. What I'd like to do, is change that code into javascript and run it in the
2
2347
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number? ----------------------------------------------------------------------- Variables are not typed; their values are. The conversion between a string and a number happens automatically. Since plus (` + `) is also used as in string concatenation, ` '1' + 1 ` is equal to ` '11' `. The string...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4274
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.