473,473 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Loading a file into embedded window

12 New Member
Hiya,

Im hoping you can help. Im making a ASP site (not .net), and i and going to create a page that has a list of articles in a list box. I want the page to load the selected article (which will be a file on my harddrive) into a embedded window if possible?. This is only a mock site and will never go live, but it needs to use a dll also.

I was thinking on the following idea.
  • i have a listbox
  • on selecting a title (which will be the same name as the file name
  • it then sends a request to my dll
  • the dll then uses a sql statement to find the file in a database and return the loaction of the file to my front end
  • but now that my asp page knows where it is

Also, i realise there are many different and easier ways to do this, but it training, and i need to show i can create a 3 teir structure. and i planned to make a archive of articles, and then to display them. if anyone has any other ideas, please suggest. this is what i was thinking it may end up looking like.

Jan 3 '08 #1
6 1236
jhardman
3,406 Recognized Expert Specialist
as you know, asp only functions when the page is being loaded, so you will either need to submit a form when the user selects an option from the <select> drop down, or you will need to use another method besides ASP, possibly ajax. Let me know if this helps.

Jared
Jan 5 '08 #2
Scrotehead
5 New Member
Or for plain old ASP you could use an iframe and load that up based on your listbox selection via Javascript.

Javascript and iframe would be along the lines of:
[HTML]<script language='JavaScript'>

function loadStuff(sArticleID){
//maybe add checks for valid article id formats... and produce nice messge for dodgy stuff --I've included the styles in the frame that you may wnat to change

window.ArticleLoader.location = 'artyldr.asp?ID='+sArticleID;

//Should put in some kinda check for timeouts (window.setTimeout(blah))
return 1;
}

</script>

<select onchange="loadStuff(this.options[this.selectedIndex].value)">
<option value=1>article one</option>
<option value=2>article two</option>
<option value=3>article three</option>
</select>

<iframe name="ArticleLoader" width=200 height=250 src="" style="visibility:visible"></iframe>[/HTML]

The article ID in the select option would refer directly to your db article key.

You would also need to have another asp page which loads your article based on the article id passed in the querystring (from Javascript)

artyldr.asp
Expand|Select|Wrap|Line Numbers
  1. <%
  2. dim strKey
  3.  
  4.   strKey = Request.QueryString("id")
  5.  
  6.   'querydb based on this id
  7.  
  8.   'Display the ouput in whatever format you want as a whole page.
  9.  
  10. %>
Clearly you will need to add a bit of CSS magic to make things look nice etc...
Jan 7 '08 #3
Kandiman
12 New Member
Or for plain old ASP you could use an iframe and load that up based on your listbox selection via Javascript.

Javascript and iframe would be along the lines of:
[HTML]<script language='JavaScript'>

function loadStuff(sArticleID){
//maybe add checks for valid article id formats... and produce nice messge for dodgy stuff --I've included the styles in the frame that you may wnat to change

window.ArticleLoader.location = 'artyldr.asp?ID='+sArticleID;

//Should put in some kinda check for timeouts (window.setTimeout(blah))
return 1;
}

</script>

<select onchange="loadStuff(this.options[this.selectedIndex].value)">
<option value=1>article one</option>
<option value=2>article two</option>
<option value=3>article three</option>
</select>

<iframe name="ArticleLoader" width=200 height=250 src="" style="visibility:visible"></iframe>[/HTML]

The article ID in the select option would refer directly to your db article key.

You would also need to have another asp page which loads your article based on the article id passed in the querystring (from Javascript)

artyldr.asp
Expand|Select|Wrap|Line Numbers
  1. <%
  2. dim strKey
  3.  
  4.   strKey = Request.QueryString("id")
  5.  
  6.   'querydb based on this id
  7.  
  8.   'Display the ouput in whatever format you want as a whole page.
  9.  
  10. %>
Clearly you will need to add a bit of CSS magic to make things look nice etc...

right, im trying the iframe thing, but im getting abit stuck... can you have a look and see where im going wrong, i think its the part where im trying to pass the value of the listbox back to the javascript...::


<%@ Language=VBScript %>
<HTML>

<script language='JavaScript'>

function loadStuff(sArticleID){

//maybe add checks for valid article id formats... and produce nice messge for dodgy stuff --I've included the styles in the frame that you may wnat to change

window.ArticleLoader.location = 'artyldr.asp?ID='+sArticleID;

return 1;

}
</script>

<!--<SCRIPT language=VBscript>
Sub RunScript
Msgbox Listbox1.Value
End Sub
</SCRIPT>-->

<HEAD>
<link rel="stylesheet" type="text/css" href="RetroToons.css">
</HEAD>
<BODY>
<FORM id="Articles" name="Articles" method="post" action="Articles.asp">
<%
dim WhichSelected

WhichSelected = Request.Form("chosen")
%>



<DIV style="Margin-Left: 120px;">

<!--#include file ="SiteHeader.asp"-->
<!--#include file ="DynamicCSS.asp"-->
<!--#include file ="Menu.asp"-->

<DIV id=Middle>

<DIV id=Mainbody>

<%
dim objArticlesNode
set objArticlesDLL = createobject("ArticlesDLL.ArticlesClass")

dim GetArticlesResult
GetArticlesResult = objArticlesDLL.RetrieveArticles

set objDOM = server.CreateObject("MSXML2.DOMDocument")
objDOM.LoadXML(GetArticlesResult)

'Response.Write Server.HTMLEncode(objDom.xml)
'Response.End
%>


<BR>
<STRONG>
Please select the title of the article you wish to read...
</STRONG>
</BR>

<BR />
<select size="3" name="Listbox1" onchange="loadStuff(this.options[this.selectedIndex].value)" colspan="50">
<%
If objDOM.selectSingleNode("Response/RESULT").Text ="SUCCESS" then
for each objSearchNode in objDOM.selectNodes("Response/Article")
%>
<option value="<%Response.Write objSearchNode.selectsinglenode("Number").text%>">
<%Response.Write objSearchNode.selectsinglenode("Title").text%>
</option>
<%
next
end if%>
</select>

<HR width=50%>

<P />
<%Response.Write "***" & WhichSelected & "***"%>

<iframe name="ArticleLoader" width=700 height=500 src="" style="visibility:visible"></iframe>

<Table>
<tr>
<td><input type="hidden" name="chosen"></td>
</tr>
</Table>

</DIV>

<DIV id=right>
<!--#include file ="RightBody.asp"-->
<!--#include file ="RightLower.asp"-->
</DIV>

</DIV>

<BR />

<!--#include file ="Footer.asp"-->

</DIV>
</FORM>
</BODY>
</HTML>
Jan 7 '08 #4
Kandiman
12 New Member
ignore me, i was being a idiot, figured it out, thanks guys... right, now im gonna try the iframe thingy.... wish me luck
Jan 7 '08 #5
Kandiman
12 New Member
okay cheers, the whole iframes things worked a treat. thanks guys!!
Jan 7 '08 #6
Scrotehead
5 New Member
okay cheers, the whole iframes things worked a treat. thanks guys!!

Glad to hear it!

----------------------------------
Jan 8 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
7
by: Christofer Dutz | last post by:
Hi, I am trying to read a XML-File which I marked as embedded resource from within the code of my DLL. Unfortunately it doesn't work. On my search for the error I inserted some code for...
4
by: Phil Da Lick! | last post by:
Hello, Got strings.resx included in my assmebly as the default language neutral collection. ResourceManager res=new ResourceManager("strings", Assembly.GetExecutingAssembly()); string...
2
by: dana lees | last post by:
Hi, I am developing a c# asp.net application. I have a button which when i click on i open a pdf file. Since the pdf file is very very large i would like to open a window that says "Loading...
3
by: Bardo | last post by:
Hi all, We are trying to debug an assembly which was built in debug configuration on our build server. The output window of visual studio indicates that no symbols are being loaded for the...
5
by: Pete Marsh | last post by:
Wondering if anyone can recomend some sample code for dynamically loading the GD module. I have tried setting the extension dir in php.ini, and loading the GD module from there when apache is...
20
RMWChaos
by: RMWChaos | last post by:
Currently testing in: WinVista / IE7 I have been working on getting xmlhttprequest going for weeks now. I have finally gotten a semi-working script going. Pulling up text or xml files works great...
20
by: Nickolai Leschov | last post by:
Hello all, I am programming an embedded controller that has a 'C' library for using its system functions (I/O, timers, all the specific devices). The supplied library has .LIB and .H files. ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
1
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...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.