more confused
Date: 09/19/05
(Asp Dot Net) Keywords: asp, web
Based on my last post this is where i have goten and its still not working
and is returning a error message as follows, i am useing .net vb what am
i doing wrong?
Compiler Error Message: BC30456: 'FindByValue' is not a member of 'System.Web.UI.WebControls.ListItem'.
Source Error:
Line 19: End Get
Line 20: Set
Line 21: dsCountryDD.SelectedItem.FindByValue(Value) = true
Line 22: End Set
Line 23: End Property
Source File: c:\inetpub\wwwroot\devotion2motion.com\UserControls\CountryDD.ascx Line: 21
countryDD.ascx page
[%@ Inherits="Devotion2Motion.DropDownsComp" Src="../CodeBehind/DropDowns.vb" ClassName="CountryDD"%]
[script language="vb" runat="server"]
Sub Page_Load()
If IsPostback = True Then
End If
Dim CountryDD As New Devotion2Motion.DropDownsComp()
' Select the country dropdown list
dsCountryDD.DataSource = CountryDD.GetCountryDD()
dsCountryDD.DataBind()
End Sub
Public Property Value As Integer
Get
Return dsCountryDD.SelectedItem.Value
End Get
Set
dsCountryDD.SelectedItem.FindByValue(Value) = true
End Set
End Property
[/script]
[asp:DropDownList DataTextField="country" DataValueField="countryID" ID="dsCountryDD" runat="server"/]
control in the aspx page
[UserContol:CountryDD Value='[%# DataBinder.Eval(Container.DataItem,"countryID") %]' runat="server"/]
Source: http://www.livejournal.com/community/aspdotnet/43315.html