Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdownlist.selecteditem.text problem 1

Status
Not open for further replies.

russellmunday

Technical User
Jul 24, 2003
87
GB
Hi I have a page that has two dropdownlists on it the first has three static values the choice made here then query's a database and fills the second dropdownlist i then need to show an image from the selection but the code i am using does not return the image.
the dropdownlist autopostback is set to true

image1.imageURL = ("c:\mypic\" & partddl.selecteditem.text & "jpg")

i have also pulled the images into the solution and changed the path but no difference is there a property i need to set on the dropdownlist?
 
Two possible problems I can think of:

1) Security issue - ASP.NET can't access that folder on your c: drive - try moving the images to a folder in c:\inetpub\ (or wherever your virtual directory points), or give permissions to that folder to the ASP.NET user account.

2) partddl.selecteditem.text isn't returning the right value - try breakpointing here and checking. You could possible use partddl.selectedvalue instead.
 
or you need the dot

image1.imageURL = ("c:\mypic\" & partddl.selecteditem.text & ".jpg")

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
thanks for the help I have however now got to the bottom of it the database table was adding extra characters so the file name had spaces and was not the right value I have changed the value in the table and all is wonderful again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top