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

J

jobs

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top