|
I have two list boxes.
First list box is filled with some enteries from database.
Now when user select one entry from first list box(client-side event) then second list box is filled with values based on that first selection.
Second list box enteries are retrived from database(server side action).
Guide me how to do this.
|
|
|
|
|
Simple solution is to use a postback in ASP.Net and then get the items for the other listbox
Other solution is to create an asp.net page which generates XML. XML can be loaded by javascript at the client side. And then you can change the entries of the second box. A thing i have to warn you is that the Viewstate will not work because the items are not set runtime. But you can still use Page.Response["ddlName"] tot get the selected one.
The last solution is very sexy i think. Maybe i will write my first article about this.
|
|
|
|
|
Thanks for ur reply.
I want code for ASP 3.0
|
|
|
|
|
mkashifkkj wrote:
I want code for ASP 3.0
I have the code of it... but its flavoured with Java Script too... interested??
I was born intelligent Education ruined me!.
|
|
|
|
|
|
The following is the code for the dropdownlist... written in ASP to pump the html code. The first drop down is for the CITY, and the other for the CATEGOREY.
<br />
<%<br />
Response.Write "<Select name='City' onClick='redirect(this.options.selectedIndex)' onFocus='redirect(this.options.selectedIndex)' onChange='redirect(this.options.selectedIndex)'>"<br />
Response.Write "<option value='Select'>Select City</option>"<br />
<br />
for ii=1 to temp_rs.RecordCount<br />
if (Request ("srchCat") = temp_rs ("City")) then<br />
selOpt = "selected"<br />
else<br />
selOpt = ""<br />
end if<br />
Response.Write "<option " & selOpt & " value='" & temp_rs ("City") & "'>" & temp_rs ("City") & "</option>"<br />
temp_rs.MoveNext<br />
next<br />
<br />
Response.Write "</select>"<br />
<br />
Response.Write "<Select name='Category' size='1'>"<br />
Response.Write "<option value='Select'>Select Category</option>"<br />
Response.Write "</select>"<br />
<br />
%><br />
The following is the JSCRIPT and ASP combined stuff......
<br />
<br />
<script><br />
<!--<br />
var groups = document.drsrchform.City.options.length<br />
var group = new Array(groups)<br />
<br />
for (i=0; i<groups; i++)<br />
group[i]=new Array()<br />
<%<br />
Dim curVal, cityCnt, catCnt, curCity<br />
cityCnt = 1<br />
catCnt = 0<br />
<br />
set conn = Server.CreateObject("ADODB.Connection")<br />
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security Info=False;" & "Data Source=" &Server.MapPath(drDatabase)<br />
Set temp_rs = Server.CreateObject("ADODB.RecordSet")<br />
SqlStr= "SELECT distinct Category, City FROM DocDetails where Country='XXX' order by City"<br />
<br />
temp_rs.Open SqlStr, conn, 1,3<br />
curCity = temp_rs ("City")<br />
<br />
Do While not temp_rs.EOF<br />
curVal = temp_rs ("Category")<br />
if (curCity <> temp_rs("City")) then<br />
cityCnt = cityCnt + 1<br />
catCnt = 0<br />
curCity = temp_rs ("City")<br />
end if<br />
%><br />
group[<%=cityCnt%>][<%=catCnt%>] = new Option ("<%=curVal%>","<%=curVal%>");<br />
<%<br />
catCnt = catCnt + 1<br />
temp_rs.MoveNext<br />
loop<br />
set temp_rs=nothing<br />
set Conn=nothing<br />
%><br />
var temp=document.drsrchform.Category<br />
function redirect(x)<br />
{<br />
for (m=temp.options.length-1;m>0;m--)<br />
temp.options[m]=null<br />
for (i=0;i<group[x].length;i++)<br />
{<br />
temp.options[i]=new Option(group[x][i].text,group[x][i].value)<br />
}<br />
temp.options[0].selected=true<br />
}<br />
</script><br />
<br />
Please notice that... if there is ANY change in the name of the vars/anything... this wont wont work.
Have fun...
I was born intelligent Education ruined me!.
|
|
|
|
|
I'm currently working as a web developer for a medium sized company (http://www.herbeau.com(Boss' old design)[^] Herbeau Creations of America to be exact). The vice-president was the previous web designer with absolutly no web experience what-so-ever.
He chose earthlink as his Web Host(*NIX server that supported front page extensions and no other MICRO$OFT app support). However we're running (1)Win2k server, (1)WinXP pro server, and (19)WinXP machines with IIS 5.1 installed and waiting for my development of the website which is to be used inner-office as well as globally on the web. Every office application is MICRO$OFT labeled and I brought Dreamweaver MX(ASP.NET/ASP oriented) into the picture. Now the problem is he wants the page to have maximum interactivity, as well as working search engines in/out of office for the customer sales reps to guide customers with.
I've been using ASP with great results, but then came to discover at the 75% mark that the current web host doesn't support ASP. (He assumed the webhost supported ASP and I didn't think to check for myself...stupid on my part ) Now the decision is to change to a window's host for product/inter-company compatability or stick with our current setup and get everything working as is with PHP. I've got PHP working with IIS as much of a pain as it is. However if possible I'd still rather turn back and go to a windows host before further complications arise. Any opinions?
Added: I'm big on jumping into the MICRO$OFT bandwagon, however when it comes to business you've gotta go with what you're already built for.
:-._'¯OMNIGOD¯'_.-:
d-o-b "Ohmmm"
|
|
|
|
|
OmniGod0101 wrote:
Any opinions?
Yes; Get a Windows host. It is going to cost your boss far more to convert the ASP app to PHP as well as train you up on PHP. Plus you won't be able to support the app as well as you could if it were ASP.
Also you may want to keep your job by sticking with ASP
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|
|
Mmmm keeping my job...good concept! Thanks for the input, much appreciated.
:-._'¯OMNIGOD¯'_.-:
d-o-b "Ohmmm"
|
|
|
|
|
Windows I hear, costs a fortune and ASP I beleive is fairly limited without COM objects(I used it for about 3 weeks and decided to switch to PHP because hosting costs were half the price of ASP), like drawing images such as PHP's gdlib or creating PDF docs on the fly using pdflib. Each of which you may or may not have to purchase seperately from third parties. PHP I would say is more widely used and therefore there are plenty of free and not so free pre-written scripts available on the net. Possibly saving you hours and $$$ when getting your site up and running with a DB backend.
Now the problem is he wants the page to have maximum interactivity, as well as working search engines in/out of office for the customer sales reps to guide customers with.
There are so many available knowledgebases out there (heck i'm writting my 4th version as we speak) which would accomplish this very task, all written in PHP.
Like you said there are more sites running PHP then ASP, probably for a reason...MySQL is less daunting than SQL server and there are tons of books on the subject. The real trick is getting Apache, MySQL, PHP to all work togather under linux(securely). Best to just rent out a dedicated server and let someone else worry about constant security fixes and such.
Sure i'm a fan of PHP obviously, but I tinkered with ASP before I did PHP...PHP just out shines ASP in all cases. Open Source I believe has a tendancy to run more efficiently, stable and secure.
OmniGod0101 wrote:
Added: I'm big on jumping into the MICRO$OFT bandwagon, however when it comes to business you've gotta go with what you're already built for.
Avoid the darkside
Just my opinion.
p.s Hockey = php programmer for hire
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hello.
I want to browser to load and play an mp3 or some other format of music on my web page .
browser - lets say IE
What is the way to do that.
Thank you in advance.
|
|
|
|
|
Please don't do that. That has got to be one of the most annoying things to do in a web page. If you really want people to come to your site, and stay, don't do that.
If you still insist though, go to this extremely annoying page to find out how to do it. MP3 is not supported by the way, so you are stuck with either WAV or MIDI or a few other formats--none of which are compressed. The reason most people don't do this is that MIDI sounds so cheezy that it's embarassing to put on your site and wav files are so large that it would take forever for a reasonable amount of audio to download. No one would ever hear it (even with broadband). Just say 'NO'.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I would have to agree. However I had a client ask, so this is what i used :
<object id="sound" classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" align="baseline" border="0" width="0" height="0">
<param name="ShowDisplay" value="0">
<param name="ShowControls" value="0">
<param name="ShowPositionControls" value="0">
<param name="ShowSelectionControls" value="0">
<param name="ShowTracker" value="0">
<param name="MovieWindowSize" value=0>
<param name="FullScreenMode" value="0">
<param name="MovieWindowWidth" value="0">
<param name="MovieWindowHeight" value="0">
<param name="AutoStart" value="1">
<param name="AutoRewind" value="1">
<param name="PlayCount" value="0">
<param name="SelectionStart" value="0">
<param name="Appearance" value="1">
<param name="BorderStyle" value="0">
<param name="FileName" value="FILE NAME GOES HERE">
<param name="DisplayMode" value="0">
<embed src="FILE NAME GOES HERE HERE TOO" name="sound" autostart="true" loop="0" hidden="true"></embed>
</object>
It worked for me...
Phaed0
|
|
|
|
|
I want my JSP page to download a file, just as on hotmail attachment is downloaded when a certain file name is clicked. Plz provide me with relevent APIs /code/sites e.t.c
The problem with me right now is when I click on the hyperlink of the file name, the file is opend in the explorer but here I want to download it on my local machine.
Reply me soon
|
|
|
|
|
Problem: I need to load a whole HTML page from memory (including images and sounds) to MSHTML. Samples, that I have found in MSDN Library (and on this site), only describes how to load HTML text.
Sorry for my english...
|
|
|
|
|
Try the VC++ forum instead.
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
How to link to a ip address
For example iam trying to cerate a link to 193.1.181.12
The webpage iam trying to link to it doesnt have a usual name like www.whatever or server.whatever it is got by typing in the ip address in the browser.
So in my web page i want to greate a link to that site
I have tryed the usual way
href="193.1.181.12"
But the page cannot be found
any suggestion ?
Reguards
Stephen
->->->->->->->->->->->->->->->->->->->->->
"Police arrested two kids yesterday, one was drinking battery acid, the other was eating fireworks. They charged one and let the other one off."
Tommy Cooper
|
|
|
|
|
You'll need to add the protocol as usual, so http://193.1.181.12 pr ftp://193.1.181.12, etc.
David Wulff
"i said no to noddy like 20 times but in the end i just couldnt say no to him anymore" - Wishful Thinking
|
|
|
|
|
Thanks David
I forgot to put the http://
Reguards
Stephen
->->->->->->->->->->->->->->->->->->->->->
"Police arrested two kids yesterday, one was drinking battery acid, the other was eating fireworks. They charged one and let the other one off."
Tommy Cooper
|
|
|
|
|
hi
try to use http://ipaddress
hi
|
|
|
|
|
I design a webservice with c#,
this webservice have some [WebMethod(EnableSession=true)]'s method
but when I use it with c++,Session lose
why?
thanks, codeproject
|
|
|
|
|
HI all,
I have been using the ASP pages all the days kicking my Windows 2000 PC. And came a bash. The ASP coding are going to be handled by some one and I am asked to see the posibilities to coverting/creating new site(s) on PHP version.
I really know NOTHING on PHP. So putting down myself here and am asking some following...
where soes PHP runs?? (ASP - IIS @ Win 2000)
database support ?? (ASP - I use MS access, SQL server)
other basic difference from ASP??? (coding, functioning, scripting)
Please help
I was born intelligent Education ruined me!.
|
|
|
|
|
SPS wrote:
where soes PHP runs?? (ASP - IIS @ Win 2000)
Normally on Linux under the Apache web server.
You can run PHP on Windows, however it is not highly recommended.
SPS wrote:
database support ?? (ASP - I use MS access, SQL server)
Any ODBC database. Most common database to use with PHP is MySQL.
SPS wrote:
other basic difference from ASP??? (coding, functioning, scripting)
The concept (Response/Request and Server) are the same. Syntax is obviously quite different.
Visit PHPBuilder.com[^] for more information. I recommend that whoever told you to do PHP should look at their reasoning more closely as it seems they are just grabbing at open source buzzwords.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|
|
Paul Watson wrote:
You can run PHP on Windows, however it is not highly recommended
Is there anything that 'doesnt work' under windows??
Paul Watson wrote:
Syntax is obviously quite different.
No problem.
Paul Watson wrote:
I recommend that whoever told you to do PHP should look at their reasoning more closely as it seems they are just grabbing at open source buzzwords.
The simple reason my boss (non-tech guy) gave made me laugh/cry.... "I saw many sites with PHP files rather than ASP files. So we MUST change to PHP." Fortunately/unfortunately our secondary web hosting company offers PHP too.. Then we had a meeting... finally some snacks/tea... Oops... WE WILL CHANGE TO PHP.
This is how PHP idea was take up..
I was born intelligent Education ruined me!.
|
|
|
|
|
SPS wrote:
Is there anything that 'doesnt work' under windows??
I don't know. Saying that though don't confuse PHP the language with the various PHP modules you can get. Like with ASP, VBScript would be the language and the FileSystemObject would be a module. When running ASP on Linux (using ChiliSoft or similar) then I suspect that the FSO object would no longer be available (as it is a COM object, Windows only.)
So probably 100% of PHP works under Windows, it is just some of the common libraries/modules for PHP that may not work.
Anyway you probably shouldn't run PHP on Windows, if anything then for the reason that you will loose all the cost savings of a Linux host
SPS wrote:
This is how PHP idea was take up..
Wow. That is rather bad. If I were you I would take a formal position on why this is a bad idea up front. They won't listen now, but when the project goes FUBAR your fears will have been stated and they can only blame themselves.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|