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>
<aspropDownList 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.
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>
<aspropDownList 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.