|
ok here's a quick demo of what I think you want to achieve. This example should be fairly easy to make database driven (just create the javascript arrays through the backend). If you need any more advice with this then just give me a shout.
note: I have not tested this in NS, but it should be pretty straighforward to update (don't have time right now to do a cross-browser version).
ps: sorry for the porky code
<body onload="init();">
<script language="Javascript">
function Client(clientID, clientName)
{
this.id = clientID;
this.name = clientName;
}
function Project(projectID, projectName, clientID)
{
this.id = projectID;
this.name = projectName;
this.clientID = clientID;
}
function Work(workID, projectID, workDescription)
{
this.id = workID;
this.projectID = projectID;
this.description = workDescription;
}
var arrClients = new Array();
var arrProjects = new Array();
var arrWork = new Array();
arrClients[0] = new Client(1, 'Company abc');
arrClients[1] = new Client(2, 'XYZ Ltd.');
arrProjects[0] = new Project(1, 'Website', 1);
arrProjects[1] = new Project(2, 'Intranet', 1);
arrProjects[2] = new Project(3, 'Report viewer', 2);
arrProjects[3] = new Project(4, 'Spreadsheet generator', 2);
arrWork[0] = new Work(1, 1, 'Database Design & Implementation');
arrWork[1] = new Work(2, 1, 'HTML Templates draft');
arrWork[2] = new Work(3, 2, 'Implement NTFS security');
arrWork[3] = new Work(4, 3, 'Implement Crystal reports functionality');
arrWork[4] = new Work(5, 3, 'Create graphing module');
arrWork[5] = new Work(6, 4, 'Submit for final budget approval');
function init()
{
frmLists.sClient.options.length = 0;
for(var i = 0; i < arrClients.length; i++)
{
frmLists.sClient.options.length += 1;
frmLists.sClient.options[i].value = arrClients[i].id;
frmLists.sClient.options[i].text = arrClients[i].name;
}
updateProjects();
}
function updateProjects()
{
var clientID;
var idx = 0;
clientID = arrClients[frmLists.sClient.selectedIndex].id;
frmLists.sProject.options.length = 0;
for(var i = 0; i < arrProjects.length; i++)
{
if(arrProjects[i].clientID == clientID)
{
frmLists.sProject.options.length += 1;
frmLists.sProject.options[idx].value = arrProjects[i].id;
frmLists.sProject.options[idx].text = arrProjects[i].name;
if(idx == 0)
frmLists.sProject.options[idx].selected = true;
idx++;
}
}
updateWork();
}
function updateWork()
{
var projectID;
var idx = 0;
projectID = frmLists.sProject.options[frmLists.sProject.selectedIndex].value;
frmLists.sWork.options.length = 0;
for(var i = 0; i < arrWork.length; i++)
{
if(arrWork[i].projectID == projectID)
{
frmLists.sWork.options.length += 1;
frmLists.sWork.options[idx].value = arrWork[i].id;
frmLists.sWork.options[idx].text = arrWork[i].description;
idx++;
}
}
}
</script>
<form name="frmLists" action="whatever.asp" method="post">
<select name="sClient" onchange="updateProjects();">
</select>
<br/>
<select name="sProject" onchange="updateWork();">
</select>
<br/>
<select name="sWork">
</select>
<br/>
</form>
</body>
|
|
|
|
|
Anyone out there know of any "fair" performance benchmarks comparing the like of ASP, ASP.NET, JSP, JServlets, etc? Trying to come up with some numbers for a presentation...
Thanks,
Jeremy Kimball
|
|
|
|
|
Does anybody know how to generate an RSS feed? As I understand it, the xml file generated is static. It is not a dynamic script. i.e., that it is generated once and then available for read by feeders. Is this true? Would I generate it each time a 'latest update' has occured? Does anyone have a sample script that generates RSS?
|
|
|
|
|
There is no rule that says the feed need be dynamic or static. Much like any other file available over the net it can be either. Depends on your requirements.
There are as many ways of making an RSS feed as there are ways to make a webpage.
Here are two methods; Create a valid RSS 2.0 document using XmlTextWriter and Google to RSS.
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
Einstein says...
|
|
|
|
|
Thanks,
If I was to make an RSS of the 'latest updates'. How would the dynamic rule work? When I first thought of it, it seemed like only when I press the RSS icon the file is generated - but that can't be true. It has to be generated before hand so that you can use feeders to read the data....
So when will be the right time to export the 'latest update' rss feed?
Thanks in advance.
|
|
|
|
|
You naturally don't want your RSS file being re-generated everytime someone hits it, rather you only want it re-generating on update to content on your website.
So I would put the RSS updater code in the same block as the code that saves/updates your website. That way the RSS is only updated when the site updates.
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
Einstein says...
|
|
|
|
|
Thanks, you have been lots of help. You have ensured my understanding.
Also, thank you for the link to the RSS article - I didn't notice it before.
I live to code.
|
|
|
|
|
Something doesn't sit right...
I noticed the RSS on codeproject and on other sites as well. It seems that it is not a static file, but instead it is generated on demand. The file is of '.asp' or '.aspx' extension. I figured it should be '.xml'. Am I wrong?
What is the prefered method by RSS feeders?
Also,
Weird thing - I can't view the source of the RSS page on codeproject.
|
|
|
|
|
I need to update a database table with the time the user logs out of my site/when their session ends.
I've been using a global.asa file with the following Session_OnEnd code, but it doesnt seem to be working for me........ can anybody help?
Sub Session_OnEnd
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=....."
query = "UPDATE User_LogTime SET Logout_Time = "now()" WHERE SID="&Session.SessionID&"
conn.Execute(query)
conn.Close
set conn = Nothing
End Sub
|
|
|
|
|
I suspect that you need to create a command object to do this..
"Your village called - They're missing their idiot."
|
|
|
|
|
Thanks Roger but I'm new to this whole .asa thing. Could you explain what you mean ???
Thanks
|
|
|
|
|
An ADO Command object returns a recordset when you call its Execute method. Since you're new at this (as I am) I suppose you could use some resources. One of my favorites is W3Schools.com[^], where you'll find free tutorials on just about anything web related.
Reviewing the code, it may not be the best answer to use a Command for this; your approach, while new to me, looks like it should work fine. You may have to reformat the result of Now() though. What database are you using?
"Your village called - They're missing their idiot."
|
|
|
|
|
Hi, I am pretty new to this too. But are actually doing the same as you do (maybe), but in C#. Sorry I don't get this to work either.
What I have explored, is that.. the sesion-variables seems to be cleared _before_ the end-session-event is ran...Anybody correct me is this is wrong.
What I did to solve the problem were making a object that I put into the session-variables and that writes info to the database when it terminates. This seems to work at me.
One last thing. It may take 20 minutes before the session ends, depending on the timeout configurations. Default is that 20 minutes. So session-end seems not to be executed right after quitting the browser..
= = = = = = = = = = = = =
Kim Amunsen
Norwegean University of Technology & Science
Major: Artificial Intelligence
|
|
|
|
|
Well, i wrote a parser for my logs in apache, and this error has occured over 3000 times in the past 2 weeks:
No directory () for Hostname www.thekeegster.com
does anyone know what this means? I've been googling, but i haven't found anything. Its clogging up my errorlog, its amazing how many occurences there are of it.
I'm runnin apache 1.3 on Linux
*.*
cin >> knowledge;
|
|
|
|
|
Is there possible to make a compiled .exe to be executed when a user enter my webpage.
Of course it is possible, but what is the best way?
I know about ActiveX but don’t want to recode my dialogproject to such a component.
I’ve read a little about making CAB files but don’t know where to start.
APe
|
|
|
|
|
Why do you want to do this? Just curious.
As for the how. If you are not willing to use ActiveX then you have to first get the EXE downloaded to the clients machine. After that, you cannot activate it yourself, you have to isntruct the user to do so themselves (this is for obvious security reasons e.g. format c: /s ).
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
Einstein says...
|
|
|
|
|
For your curious....
I'm developing a program that my clients need to see, (during my "development process"). Until now I've send the .exe and yeah it work but it would bee easier for him/them to just tape in my www-url in a browser and get the last version I've published.
I've thought about creating an ActiveX that calls my exe with for e.g. ShellExecute(...)..... ???
He sure will trust my ActiveX in his browser.
The problen is to (inside my ActiveX) upload my exe to the client and make it run......
Realy thanks for your comments
.....and justice for all
APe
|
|
|
|
|
ahh ok, you should look into the technologies which Microsoft and others have provided for automatic updating of apps. e.g. In MSN Messenger it polls a website to see if there are any EXE updates, if there is then it alerts you, downloads the update and installs it.
I *think* the MS tech is called BITS.
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
Einstein says...
|
|
|
|
|
Paul Watson wrote:
I *think* the MS tech is called BITS.
Good thinking! And here's the instructions[^] for implementing it. It only works on XP, and requires VS.Net to develop custom apps using it, but it's freely available.
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
I have a very small question (a very big question for me though) about Server Side VBScript in ASP pages.
To fetch information from a HTML input textfield like the
( in a VBScript line, will return the error "Object required" (which clearly indicates my existing limitations in VBScript).
What is the VBScript syntax for this?
(there are tons of good java examples out there, but with VBScript...)
Best regards,
Emelian
|
|
|
|
|
Given a form:
<FORM NAME=Form1 ACTION="MyScript.asp" METHOD="POST">
<INPUT NAME=Test TYPE="TEXT">
<INPUT TYPE="SUBMIT" Value="Submit">
</FORM>
to retrieve the value typed into the textbox after pressing the Submit button use
<%
strTestInfo = Request.Form("Test")
%>
in the page named MyScript.asp.
[EDIT]
An excellent book, "Beginning Active Server Pages 3.0" from Wrox Press is still available, though Wrox went belly up before I could purchase its Advanced volume. It presents the subject very clearly and uses VBScript throughout - it's been an invaluable aid to me.
[/EDIT]
"Your village called - <BR>They're missing their idiot."
|
|
|
|
|
Thanks for your help, Roger!
I read some time ago about the "Request.Form(), but I'll guess the beers I had between now and then, probably wiped it all out from my mind.
Your suggestion doesn't work for me, because I'm using the "onClick" to call a small script before posting to the next page. I need to read the "Value" from the very same page that it is entered on.
.
.
.
.
In a page, it is possible to have several forms which actually can contain the same names of the "
|
|
|
|
|
I realised that using Request.Form(), will only fetch data from a post on a previous page (and from that particular posted form). That sorts out the later part in my last reply.
And about fetching values in "input text fields" on the current page by using serverside scripts, probably is a question of travelling between two parallel universes (server-side & client-side).
But the question remains... Is it possible to make the server-side script able to fetch values on an existing page before executing a post to the next page?
Regards,
Emelian
|
|
|
|
|
Emelian wrote:
Is it possible to make the serverside script to fetch values on an existing page before executing a post to the next page?
Probably, but I haven't had a need for it yet. Stick around - someone smarter than me is bound to show up.
"Your village called - They're missing their idiot."
|
|
|
|
|
Solved the problem by forcing the page to post the data into same page, when I press the "Submit" -button. But not a very nice way to solve a simple data handling, is it?
But the challange is still on, to find a solution that does it without making a "post".
Any suggestion or contribution is most welcome!
Regards,
Emelian
BTW... Thanks Roger, for spending your time and effort on this!
|
|
|
|