Solved

ASP.NET + LINQ + DropdownList

Posted on 2013-07-01
2
548 Views
Last Modified: 2013-07-03
I have populated my dropdownlist binding them to a LINQ datasource, without codebehind is there a way to select one of the values as the selected value, or if not add a value to the dropdownlist as the selected value.
0
Comment
Question by:dkilby
2 Comments
 
LVL 8

Accepted Solution

by:
Arabia_vn earned 500 total points
ID: 39294252
Then you have to set it from client side by using javascript, something like this

    <script type="text/javascript">
        document.getElementById('<%= ddlExample.ClientID %>').selectedIndex = 2;
    </script>
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39294257
Hi,

I don't think it possible, with out using Code behind!

Hope it helps u...
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…

679 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