Solved

Need help on Dropdownlistbox -Asp.net using VB

Posted on 2004-09-11
8
212 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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:zachvaldez
Comment Utility
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
Comment Utility
please post your code
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:zachvaldez
Comment Utility

 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
Comment Utility
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
Comment Utility
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
Comment Utility
That was splendid./ It was my error. I renamed the control(DDL) and I ddid not in the code.
Thanks John
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

13 Experts available now in Live!

Get 1:1 Help Now