Solved

Need help on Dropdownlistbox -Asp.net using VB

Posted on 2004-09-11
8
219 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
Industry Leaders: 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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need syntax help building hyperlink 2 53
Adding items to a C# list incrementally 5 82
ASP.net Will we ever be able to build mobile apps in it 6 113
CSS question 16 62
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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