Solved

Date Picker Not Working Inside A FormView But Does When Not In A FormView -- Urgent 500 points

Posted on 2006-12-01
2
367 Views
Last Modified: 2013-11-20
Hello Experts,
500 ponints question because I am on a tight project deadline and need expert assistance PLEASE..

Can anyone help me figure this out. I have date picker code that works famously in side a regular Web Form, but when I place it inside the FormView Tags inside the EditItemTemplate, I received all kinds of errror...Declaration errors first then when I dim em' that is fixed and then I get errors that pertain to WithEvents.

Any Idea why the first code below works great but when placing in inside the FormView, it will not work the same. Should I add something to the Sub....The Code is below.

GOOD CODE NO FORMVIEW:
==========================================================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">

 <script language="VB" runat="server">
      
    Sub ibtnCal1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnCal1.Click
        cldpickdate1.Visible = True
    End Sub
    Sub cldpickdate1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cldpickdate1.SelectionChanged
        cldpickdate1.Visible = False
        Date1Textbox.Text = cldpickdate1.SelectedDate
    End Sub            
    Sub ibtnCal1End_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnCal1End.Click
        cldpickdate1End.Visible = True
    End Sub
    Sub cldpickdate1End_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cldpickdate1End.SelectionChanged
        cldpickdate1End.Visible = False
        Date1EndTextbox.Text = cldpickdate1End.SelectedDate
    End Sub
</script>
<title>Date Picker</title>
</head>
<body><center> Date Picker Not In A FormView Working Fine!
    <form id="form1" runat="server">
        <asp:TextBox ID="Date1Textbox" runat="server"
            Width="75px" ReadOnly="true" BackColor="LemonChiffon" Font-Names="Verdana" Font-Size="8pt" ForeColor="Firebrick"></asp:TextBox>
        <asp:ImageButton ID="ibtnCal1" runat="server" CausesValidation="False"
            ImageUrl="Images/calendar.gif" /><br />
            <asp:Calendar ID="cldpickdate1" runat="server" BackColor="White" BorderColor="#0066ff"
            BorderStyle="Groove" CellPadding="4" DayNameFormat="FirstLetter" Font-Names="Verdana"
            Font-Size="8pt" ForeColor="Black" Height="163px" TitleFormat="Month"
            Width="111px" Visible="False">
            <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
            <SelectorStyle BackColor="#660000" />
            <NextPrevStyle VerticalAlign="Bottom" />
            <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
            <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
            <TitleStyle BackColor="LightSteelBlue" BorderColor="Black" Font-Bold="True" ForeColor="Black" />
            <WeekendDayStyle BackColor="#FFFFCC" />
            <OtherMonthDayStyle ForeColor="#CCCCCC" />
        </asp:Calendar>
        <br />
        <br />
          <asp:TextBox ID="Date1EndTextbox" runat="server"
            Width="75px" ReadOnly="true" BackColor="LemonChiffon" Font-Names="Verdana" Font-Size="8pt" ForeColor="Firebrick"></asp:TextBox>
        <asp:ImageButton ID="ibtnCal1End" runat="server" CausesValidation="False"
            ImageUrl="Images/calendar.gif" /><br />
            <asp:Calendar ID="cldpickdate1End" runat="server" BackColor="White" BorderColor="#0066ff"
            BorderStyle="Groove" CellPadding="4" DayNameFormat="FirstLetter" Font-Names="Verdana"
            Font-Size="8pt" ForeColor="Black" Height="163px" TitleFormat="Month"
            Width="111px" Visible="False">
            <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
            <SelectorStyle BackColor="#660000" />
            <NextPrevStyle VerticalAlign="Bottom" />
            <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
            <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
            <TitleStyle BackColor="LightSteelBlue" BorderColor="Black" Font-Bold="True" ForeColor="Black" />
            <WeekendDayStyle BackColor="#FFFFCC" />
            <OtherMonthDayStyle ForeColor="#CCCCCC" />
        </asp:Calendar>
        </form>
   </center>
</body>
</html>

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

SAME CODE NOT WORKING INSIDE FORMVIEW & EDITITEMTEMPLATE:

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

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<script language="VB" runat="server">
    Sub ibtnCal1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnCal1.Click
        cldpickdate1.Visible = True
    End Sub
    Sub cldpickdate1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cldpickdate1.SelectionChanged
        cldpickdate1.Visible = False
        Date1Textbox.Text = cldpickdate1.SelectedDate
    End Sub
    Sub ibtnCal1End_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnCal1End.Click
        cldpickdate1End.Visible = True
    End Sub
    Sub cldpickdate1End_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cldpickdate1End.SelectionChanged
        cldpickdate1End.Visible = False
        Date1EndTextbox.Text = cldpickdate1End.SelectedDate
    End Sub
</script>
<title>Date Picker</title>
</head>
<body><center>
 <asp:FormView ID="FormView1" runat="server">
 <EditItemTemplate>
        <asp:TextBox ID="Date1Textbox" runat="server"
            Width="75px" ReadOnly="true" BackColor="LemonChiffon" Font-Names="Verdana" Font-Size="8pt" ForeColor="Firebrick"></asp:TextBox>
        <asp:ImageButton ID="ibtnCal1" runat="server" CausesValidation="False"
            ImageUrl="Images/calendar.gif" /><br />
            <asp:Calendar ID="cldpickdate1" runat="server" BackColor="White" BorderColor="#0066ff"
            BorderStyle="Groove" CellPadding="4" DayNameFormat="FirstLetter" Font-Names="Verdana"
            Font-Size="8pt" ForeColor="Black" Height="163px" TitleFormat="Month"
            Width="111px" Visible="False">
            <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
            <SelectorStyle BackColor="#660000" />
            <NextPrevStyle VerticalAlign="Bottom" />
            <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
            <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
            <TitleStyle BackColor="LightSteelBlue" BorderColor="Black" Font-Bold="True" ForeColor="Black" />
            <WeekendDayStyle BackColor="#FFFFCC" />
            <OtherMonthDayStyle ForeColor="#CCCCCC" />
        </asp:Calendar>
        <br />
        <br />
       
          <asp:TextBox ID="Date1EndTextbox" runat="server"
            Width="75px" ReadOnly="true" BackColor="LemonChiffon" Font-Names="Verdana" Font-Size="8pt" ForeColor="Firebrick"></asp:TextBox>
        <asp:ImageButton ID="ibtnCal1End" runat="server" CausesValidation="False"
            ImageUrl="Images/calendar.gif" /><br />
            <asp:Calendar ID="cldpickdate1End" runat="server" BackColor="White" BorderColor="#0066ff"
            BorderStyle="Groove" CellPadding="4" DayNameFormat="FirstLetter" Font-Names="Verdana"
            Font-Size="8pt" ForeColor="Black" Height="163px" TitleFormat="Month"
            Width="111px" Visible="False">
            <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
            <SelectorStyle BackColor="#660000" />
            <NextPrevStyle VerticalAlign="Bottom" />
            <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
            <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
            <TitleStyle BackColor="LightSteelBlue" BorderColor="Black" Font-Bold="True" ForeColor="Black" />
            <WeekendDayStyle BackColor="#FFFFCC" />
            <OtherMonthDayStyle ForeColor="#CCCCCC" />
        </asp:Calendar>
       </EditItemTemplate>
            </asp:FormView>
    </center>
</body>
</html>

0
Comment
Question by:Tone' Shelby
2 Comments
 
LVL 4

Accepted Solution

by:
bdunz19 earned 500 total points
ID: 18062676
I think you're in the wrong topic area mate!
0
 
LVL 9

Author Comment

by:Tone' Shelby
ID: 18068352
Thanks, I added it now to the VB.Net area instead.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 125
withoutTen challenge 14 122
unix example issues 18 90
Way to decrease size of apk file 9 69
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question