Solved

Need help on Dropdownlistbox -Asp.net using VB

Posted on 2004-09-11
8
213 Views
Last Modified: 2008-02-26
Is it possible to use the dropdownlist to open an HTML file.
I'd like to see an dropdownlist that if I select this item it opens an HTML document pertaining to the selection.
I'm building a schedule of events driven by this dropdownlist. I have the HTML documents to.
I wanted to show the HTML document when the item(or date of event is selected)

How is that done in code? VB please ...

0
Comment
Question by:zachvaldez
8 Comments
 
LVL 17

Assisted Solution

by:AerosSaga
AerosSaga earned 100 total points
ID: 12036315
so in essense on selected index change event you just want to redirect to that page
how are you getting the selections to the drop down list?  Are they pulling from your db?  Could you just redirect to that page on selection with something like this?

If me.myddl.selectedvalue = "x" Then
Response.Redirect("MyPageX.aspx")
End If

Let me know

Regards,

Aeros
0
 
LVL 18

Assisted Solution

by:DotNetLover_Baan
DotNetLover_Baan earned 100 total points
ID: 12036336
0
 

Author Comment

by:zachvaldez
ID: 12036754
Thanks dotNelover for the link however, it is in Java and I won't be able to figure that out.
I would appreciate if you can redirect me to the VB version.

My HTML files reside on a particular folder depending on what event and date.
In the DDL I  essentially have dates. If I select a date , it would fire and open the HTML doc
with the details.

Thanks...
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12036764
please post your code
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:zachvaldez
ID: 12037039

 I don't have the code yet for that. I'm new to asp.net.
0
 
LVL 10

Accepted Solution

by:
jnhorst earned 300 total points
ID: 12037128
Put a dropdown list on your page.  Right click it and select Properties from the window.  Give it an id (I'll use ddlPages).  Set the AutoPostBack property to true.  In the properties window, click in the box next to Items (this will be the very bottom of the list of properties).  Click the button to open the ListIem Collection Editor.  Add a few items with descriptive text in the text and the actual URLs in the value for the items.  If the pages are on the same application, just use relative paths (e.g. "SomeFolder/SomePage.html").  You can use a full "http://..." url if needed.

After you have populated the dropdwonlist with items, double click on the control in the design view of the page.  This will cause the SelectedIdexChanged event to be written in your codebehind page.  Code it as follows:

Response.Redirect(ddlPages.SelectedItem.Value)

And that is it!  You can get your items by binding to a datasource as well, just make sure that the ValueMember is a column in your datasource that has the URL for the page you want to show.

John
0
 

Author Comment

by:zachvaldez
ID: 12040013
I tried it but it did not open my html which righ now is at

C:\Documents and Settings\Joseph Valdez\My Documents\uploads\HTML

The complete file is :C:\Documents and Settings\user1\My Documents\uploads\HTML\August 29th 2004.htm

I placed this in the value of the DDL.

Also I have another one which is
C:\Documents and Settings\user1\My Documents\uploads\HTML\September 5th 2004.htm

My DDL are displaying the dates - August 29 and SEpt 5 respectively which I believe are the text that I typed.

My plan is to when I select the date, the selectchanged fires  and it opens the corresponding document.

Any idea why it is not opening up?  thanks - I'm starting to wet my feet with asp.net!
THANKS
0
 

Author Comment

by:zachvaldez
ID: 12040062
That was splendid./ It was my error. I renamed the control(DDL) and I ddid not in the code.
Thanks John
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now