?
Solved

ASP:Calendar will not allow me to set NextMonthText to an image

Posted on 2006-05-08
2
Medium Priority
?
428 Views
Last Modified: 2008-02-01
I am doing this

                  <asp:calendar id="Calendar3" style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 56px"
                        runat="server" Width="220px" ForeColor="#003399" BorderWidth="1px" BackColor="White" DayNameFormat="FirstLetter"
                        Height="200px" Font-Size="8pt" Font-Names="Verdana" BorderColor="#3366CC" CellPadding="1"
                        OnSelectionChanged="DateSelected">
                        <TodayDayStyle ForeColor="White" BackColor="#99CCCC"></TodayDayStyle>
                        <SelectorStyle ForeColor="#336666" BackColor="#99CCCC"></SelectorStyle>
                        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF"></NextPrevStyle>
                        <DayHeaderStyle Height="1px" ForeColor="#336666" BackColor="#99CCCC"></DayHeaderStyle>
                        <SelectedDayStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedDayStyle>
                        <TitleStyle Font-Size="10pt" Font-Bold="True" Height="25px" BorderWidth="1px" ForeColor="#CCCCFF"
                              BorderStyle="Solid" BorderColor="#3366CC" BackColor="#003399"></TitleStyle>
                        <WeekendDayStyle BackColor="#CCCCFF"></WeekendDayStyle>
                        <OtherMonthDayStyle ForeColor="#999999"></OtherMonthDayStyle>
                                                       NextMonthText = "<img src='/quickstart/aspplus/images/monthright.gif' border=0>"
                        PrevMonthText = "<img src='/quickstart/aspplus/images/monthleft.gif' border=0>"
                        SelectorStyle-BackColor="#99ccff"
                        SelectWeekText = "<img src='/mages/selweek.gif' border=0 onmouseover=this.style.backgroundColor='#ffcc66' onmouseout=this.style.backgroundColor='#99ccff'>"
                        SelectMonthText = "<img src='/images/selmonth.gif' border=0 onmouseover=this.style.backgroundColor='#ffcc66' onmouseout=this.style.backgroundColor='#99ccff'>"
                  </asp:calendar>

The control is not created. There is an error "type System.Web.UI.WebControls.Calendar does not have a property named img"  The above code is adapted from the QuickStart  http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/calendar/doc_cal.aspx

Anybody knows what I am doing wrong.  I am using VS.NET 2003 and .NET 1.1

Thanks

0
Comment
Question by:gbzhhu
2 Comments
 
LVL 6

Accepted Solution

by:
the_paab earned 2000 total points
ID: 16632374
Look at this:
                   <asp:calendar id="Calendar3" style="Z-INDEX: 103; LEFT: 400px; POSITION: absolute; TOP: 56px"
                    runat="server" Width="220px" ForeColor="#003399" BorderWidth="1px" BackColor="White" DayNameFormat="FirstLetter"
                    Height="200px" Font-Size="8pt" Font-Names="Verdana" BorderColor="#3366CC" CellPadding="1"
                    OnSelectionChanged="DateSelected"
NextMonthText = "<img src='/quickstart/aspplus/images/monthright.gif' border=0>"
PrevMonthText = "<img src='/quickstart/aspplus/images/monthleft.gif' border=0>"
SelectWeekText = "<img src='/mages/selweek.gif' border=0 onmouseover=this.style.backgroundColor='#ffcc66' onmouseout=this.style.backgroundColor='#99ccff'>"
SelectMonthText = "<img src='/images/selmonth.gif' border=0 onmouseover=this.style.backgroundColor='#ffcc66' onmouseout=this.style.backgroundColor='#99ccff'>"
SelectorStyle-BackColor="#99ccff"
>
                    <TodayDayStyle ForeColor="White" BackColor="#99CCCC"></TodayDayStyle>
                    <SelectorStyle ForeColor="#336666" BackColor="#99CCCC"></SelectorStyle>
                    <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF"></NextPrevStyle>
                    <DayHeaderStyle Height="1px" ForeColor="#336666" BackColor="#99CCCC"></DayHeaderStyle>
                    <SelectedDayStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedDayStyle>
                    <TitleStyle Font-Size="10pt" Font-Bold="True" Height="25px" BorderWidth="1px" ForeColor="#CCCCFF"
                         BorderStyle="Solid" BorderColor="#3366CC" BackColor="#003399"></TitleStyle>
                    <WeekendDayStyle BackColor="#CCCCFF"></WeekendDayStyle>
                    <OtherMonthDayStyle ForeColor="#999999"></OtherMonthDayStyle>
                                                                                             
           
               </asp:calendar>
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 16637865
Thank you thata worked fine.  Am I right that I was closing the tag in the wrong place because NextMonthText  is an attribute of asp:calendar but I had NextMonthText  outside of the asp:calendar tag

Thanks again
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

809 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