[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2006-12-01
2
Medium Priority
?
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
bdunz19 earned 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

650 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