DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 15 Aug 2007 12:02:22 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    jobs


Simple user control with a single ReadOnly Property. "NOT A MEMBER OF" ??   
Simple user control with a single ReadOnly Property. "NOT A MEMBER
OF" ??

 Hi,  I'm trying to create a simple Custom User control with three
dropdowns (one for day, month and year). that will return a string in
mm/dd/yyyy format.

My control will be called DateDropDown.

This is likely a novice mistake and pardon any incorrect lingo, but
why can't I see a Readonly property from  my control in the codebehind
of a asp.net page that uses the control.

This code gives me an error on the second line saying returndate is
not a member of DateDropDown

Dim BirthDate As DateDropDown =
CType(FormMaint.FindControl("DateDropDown"), DateDropDown)

Dim vBirthDate As String = BirthDate.ReturnDate()

 My user control  code:

 <%@ Control Language="VB" AutoEventWireup="false"
ClassName="DateDropDown" CodeFile="DateDropDown.ascx.vb"

Inherits="DateDropDown" %>


<script runat="server">


Public ReadOnly Property ReturnDate() As String

Get

Return DOBDay.SelectedValue.ToString + "/" +
DOBMonth.SelectedValue.ToString + "/" + DOBYear.SelectedValue.ToString

End Get

End Property

</script>



<asp:DropDownList ID="DOBDay" runat="server">

<asp:ListItem Selected="True">01</asp:ListItem>

<asp:ListItem>01</asp:ListItem>

<asp:ListItem>02</asp:ListItem>

<asp:ListItem>03</asp:ListItem>

<asp:ListItem>04</asp:ListItem>

<asp:ListItem>05</asp:ListItem>

 .. code continues.

==============

Thanks for any help or information.
Date:Wed, 15 Aug 2007 12:02:22 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us