• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 566
  • Last Modified:

ASP.NET + LINQ + DropdownList

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
dkilby
Asked:
dkilby
1 Solution
 
Arabia_vnCommented:
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
 
Roopesh ReddyCommented:
Hi,

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

Hope it helps u...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now