andyhyderabad
New Member
So I have an asp.net application that I'm trying to use upgrade. What I want to accomplish is to use the value selected in one Dropdownlist to determine the values shown in a second dropdownlist. To this extent I created the two DDL's and bound them to LINQDataSource objects in the markup. What I figured I'd do is bind the second LinqDatasource to a List(of tablename) list that I create on form Load that way I have the collection in memory and can run LINQ on it client side so I dynamically determine the return set of the datasource and thusly the values in the Dropdownlist.I saw you can supposedly point your LinqDataSource to a list as long as the list is a property. So I have tried the following but get an error saying it can't find my class.\[code\]<aspropDownList ID="ddlTitle" runat="server" DataTextField="Title" DataValueField="Title" DataSourceID="ViolationTitles" Width="203px" > </aspropDownList> <aspropDownList ID="ddlChapters" runat="server" DataTextField="FullChapterName" DataValueField="Chapter_Number" DataSourceID="ViolationChapters" Width="203px"> </aspropDownList> <asp:LinqDataSource ID="ViolationTitles" runat="server" ContextTypeName="ARS_LINQ_Connections.ARSDataContext" EntityTypeName="" Select="new (key as Title, it as Violation_Title_Chapters)" TableName="Violation_Title_Chapters" GroupBy="Title"> </asp:LinqDataSource> <asp:LinqDataSource ID="ViolationChapters" runat="server" ContextTypeName="Test" EntityTypeName="" TableName="rsViolations" Select='new (Title, Chapter_Number, Chapter_Name, String.Concat(Chapter_Number + ". " + Chapter_Name) as FullChapterName)'> </asp:LinqDataSource>\[/code\]Code Behind\[code\]Public Class Test Inherits System.Web.UI.Page Public Property rsViolations As New List(Of Violation_Code) Dim arslinq As New ARS_LINQ_Connections.ARSDataContext Dim rsTitles As New List(Of Violation_Title_Chapter) Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load rsViolations = (From v In arslinq.Violation_Codes).ToList rsTitles = (From t In arslinq.Violation_Title_Chapters).ToList End SubEnd Class\[/code\]