You can't in ASP.NET as it is a server side language. The only thing you could possibly do is use a client-side method such as javascript or an ActiveX control.
in addtion to to what ca8msm said. if you populate a list box from the client using JS (file still must be accessible from the server); event validation will fail because the value didn't originate from the server. (this is by design).
I found this out while experimenting with cascading dropdowns in the MS AJAX toolkit.
you could turn off event validation for this specific page. I consider that poor programming design and would not recommend it. then again, if the information is not that sensative, it's not a threat so you could disable the validation.
if you need to populate the list box from their computer, the user will need to upload the file to the server. then have the server populate the dropdown list with the xml file located on the server.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.