Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help on Dropdownlistbox -Asp.net using VB

Posted on 2004-09-11
8
Medium Priority
?
233 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 400 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 400 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 1200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

927 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