Hi Erik,
Thanks for your reply - on the issue of referencing the text box I am obviously doing something wrong!
This is what I have in the ascx file: -
<tr>
<td style="height: 27px; width: 144px;">
Expiry Date :</td>
<td style="width: 40px; height: 27px">
<asp:TextBox ID="ExpiryDate" runat="server" Width="104px" OnTextChanged="ExpiryDate_TextChanged" Text='<%# Bind("ExpiryDate", "{0:d}") %>'></asp:TextBox> </td>
</tr>
Note that I have a FormView control with an InsertItemTemplate in which the above has been placed.
The top of the ascx file contains this: -
<%@ Control Language="VB" AutoEventWireup="false" Inherits="BM.Modules.BM_ThingsForSale.BM_ViewThingsForSale" CodeFile="BM_ViewThingsForSale.ascx.vb" Explicit="True" %>
<%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="cc1" %>
<%@ Register Assembly="DotNetNuke.WebUtility" Namespace="DotNetNuke.UI.Utilities" TagPrefix="ccl" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx"%><br />
This is what I have in the .vb file: -
Protected Sub Add_MyListing_LinkButton_Click(
ByVal sender
As Object,
ByVal e
As System.EventArgs)
Handles Add_My_Listing_LinkButton.Click
Me.FormView1.Visible = True
ExpiryDate.Text = Date.Today.ToString
End Sub
This gives me an error: -Name "ExpiryDate" not declared.
I assume I am doing something really stupid (considering my lack of asp.net experience!!)
Thanks