Advertisement

04.27.2007 at 02:36PM PDT, ID: 22539543
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Validate a Calendar Control ASP.Net 2.0

Asked by vstack in SQL Server 2005, MS SQL Server, Programming for ASP.NET

Tags: , , ,

ASP.Net 2.0

I am using a gridview wired to a detailsview to insert, update, and delete in mysoccer league schedule.

I have a niggling issue.  I use a template field to display a calendar control on edit and insert.  On edit, the calendar shows with the correct date selected (the date of the updateable game), no problem.

On insert, however, I want the selected date to be Todays date.  When the calendar shows, Todays date is highlighted to show the current date BUT no date is selected.  If the user clicks INSERT without actually clicking on a date, no date is sent to the database and the system dies.  If the user actually clicks a date, no problem.

Is there a way to validate that a date was actually selected (validation controls don't work)?  Or is there a way in my insertsql to insert todays date in if a valid date is not passed from the application?  This would work if the user clicks insert thinking that the shaded Today is actually selected (it isn't).

Is there a work around using parameters?
Here is the calendar:

<asp:Calendar ID="Calendar2" runat="server" BackColor="White" BorderColor="#999999"
                        CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
                        ForeColor="Black" Height="180px" SelectedDate='<%# Bind("TheDate") %>' Width="200px" ToolTip="You must select a date">
                        <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                        <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                        <SelectorStyle BackColor="#CCCCCC" />
                        <WeekendDayStyle BackColor="#FFFFCC" />
                        <OtherMonthDayStyle ForeColor="Gray" />
                        <NextPrevStyle VerticalAlign="Bottom" />
                        <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                        <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    </asp:Calendar>

I am trying to migrate from Classic ASP to .net and it is frustrating but every now and then there is a wow factor with this .net stuff.

Struggling along.

Thanks

Vince Stack
Start Free Trial
[+][-]04.27.2007 at 03:02PM PDT, ID: 18992467

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.27.2007 at 03:04PM PDT, ID: 18992479

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.16.2007 at 12:38PM PDT, ID: 20088366

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, MS SQL Server, Programming for ASP.NET
Tags: calendar, control, date, validate
Sign Up Now!
Solution Provided By: EmpireIron
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.18.2007 at 05:44AM PDT, ID: 20100303

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42