• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 568
  • 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.
1 Solution
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;
Roopesh ReddyIT AnalystCommented:

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

Hope it helps u...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

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