Click here to Skip to main content
12,949,700 members (96,009 online)
Rate this:
Please Sign up or sign in to vote.
See more:
A Calendar control is used in a page based on a master page. In any web brower, the Calendar does not show the Title and the Next/Previous Month in right poistion after I define a css for the Calendar - they are extended from the Calendar to the right edge of the browing window, and not on the top of Calendar. But if I don't define it's position in the css, the Calendar works fine.

The code of the page is
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
            position: absolute;
            top: 100px;
            left: 100px;
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Calendar ID="Calendar1" runat="server" CssClass="newStyle1">
        <NextPrevStyle HorizontalAlign="Center" />
        <TitleStyle HorizontalAlign="Center" 
            VerticalAlign="Top" />

The code of the mater page is:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head  runat="server">
    <asp:ContentPlaceHolder id="head" runat="server">
    <form id="form1"  runat="server">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

I don't know what happended to the Calendar. Could any one give me some help?
Posted 14-Dec-12 6:06am
Updated 14-Dec-12 6:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The fun with css and controling content within web pages (either ASP or HTML etc...)

Check the size of where your calendar is on the page is big enough to show the missing content, ie, it could be getting cut off of the page/div.

also make sure you don't have anything that is working with the calendar in the css is not taking just the control and not the full parts of the control with it.

Some css properties will override some controls like that.

So move it on the page to a larger area to see if it shows when it is in a different spot or check to see if you have any sizing being applied to that control.

something in your css is overriding those parts of that control, but the tricky thing is how to correct it or find out why.

css file content might help to troubleshoot.

Hope that helps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,489
CHill60 3,380
Maciej Los 2,913
Jochen Arndt 1,935
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web01 | 2.8.170524.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100