views:

47

answers:

2

I created a DatePicker user control (ASP code below, no code behind) which is simply a textbox, image button, and a sometimes visible calendar.

<%@ Control Language="vb" AutoEventWireup="false" _
    CodeBehind="myDatePicker.ascx.vb"
    Inherits="Website.myDate" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" _
    tagprefix="asp" %>

<asp:TextBox ID="Date1" runat="server"></asp:TextBox>
<asp:Image ID="Image1" runat="server" ImageUrl="~/Calendar_scheduleHS.png" />

<asp:CalendarExtender ID="Date1_CalendarExtender" runat="server" Enabled="True" 
    TargetControlID="Date1" PopupButtonID="Image1"  >
</asp:CalendarExtender>

Can I somehow tie or pass the value of the TextBox as the value of the whole control to use in the calling code?

EDIT: My actual goal here is to be able to tie the SelectedDate as a parameter of a database query. I was able to select values for the other parameters in a controls dropdown list in a query parameter configuration window.

A: 

Are you saying you want to get the date from the CalendarExtender? If so, you can use the SelectedDate property on the CalendarExtender for that.

rossisdead
A: 
Claudio Redi