Solved

Need help on Dropdownlistbox -Asp.net using VB

Posted on 2004-09-11
8
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:AerosSaga
ID: 12036764
please post your code
0
 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 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