CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2006
    Posts
    181

    AJAX Support Messed Up

    I'm using VS 2008. I have SP1 and I'm using .NET 3.5.

    I just started creating a new web project. I went to add calendar extender to a text box but noticed that little button with '>' was missing so I couldn't get to the add extender option. I then noticed the AJAX Control Toolkit tab was missing from the toolbox. I then manually added the AJAX Control Toolkit tab back and added the control back into the tab. After that I got the '>' button back and was able to add the calendar extender. However, it's not working right. When the calendar pops up it's about 1/2 below the text box instead of right underneath. Worse yet, if I open up the calendar control a second time the controls and stuff in it are all messed up and rearranged. Also, the content of the table cell the stuff is in disappears while the calendar is displayed.

    I loaded up a previous project and everything seems to be working there. So this must be with new projects.

    Here's the markup from the new projects.

    Code:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="AstraCalendar._Default" %>
    
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    
        <div>
        
        <table style="background-color: #D6E7EF; border-right: black 1pt solid; border-top: black 1pt solid; border-left: black 1pt solid; border-bottom: black 1pt solid;" cellpadding="0" cellspacing="0">
            <tr>
                <td style="background-color: #006699; color: #e0e0e0; font-size: small; padding-left: 4px;">
                    Calendar
                </td>
            </tr>
            <tr style="position: relative">
                <td style="padding: 4px; margin-left: 80px;">
                    Start Date
                    <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
                    <asp:CalendarExtender ID="txtStartDate_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtStartDate">
                    </asp:CalendarExtender>
                    End Date
                    <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
                    <asp:CalendarExtender ID="txtEndDate_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtEndDate">
                    </asp:CalendarExtender>
                    <hr />
                    <asp:PlaceHolder ID="placeHolderReport" runat="server" />
                </td>
            </tr>
        </table>
    
    
        </div>
        </form>
    </body>
    </html>
    There's no code for the project. Can someone help me figure out what's going on?


    Thanks,
    Attached Images Attached Images  

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: AJAX Support Messed Up

    Here: http://www.asp.net/ajax/ajaxcontrolt.../Calendar.aspx

    Code:
    <ajaxToolkit:Calendar runat="server"
        TargetControlID="Date1"
        CssClass="ClassName"
        Format="MMMM d, yyyy"
        PopupButtonID="Image1" />
    * TargetControlID - The ID of the TextBox to extend with the calendar.
    * CssClass - Name of the CSS class used to style the calendar. See the Calendar Theming section for more information.
    * Format - Format string used to display the selected date.
    * PopupButtonID - The ID of a control to show the calendar popup when clicked. If this value is not set, the calendar will pop up when the textbox receives focus.
    * PopupPosition - Indicates where the calendar popup should appear at the BottomLeft(default), BottomRight, TopLeft, TopRight, Left or Right of the TextBox.
    * SelectedDate - Indicates the date the Calendar extender is initialized with.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Oct 2006
    Posts
    181

    Re: AJAX Support Messed Up

    Umm, what was the point in posting info about a calendar control? I'm looking for a way to fix VS. When I get a chance I think I'll try reinstalling it.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: AJAX Support Messed Up

    It looks like some CSS styling has gone crazy. Have you tried removing all CSS and seeing if the calendar renders differently?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Oct 2006
    Posts
    181

    Re: AJAX Support Messed Up

    I don't have any css on the page aside from what the calendar control includes.

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: AJAX Support Messed Up

    I see style tags all throughout that page. You mean those are added by Microsoft?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  7. #7
    Join Date
    Oct 2006
    Posts
    181

    Re: AJAX Support Messed Up

    Oh, sorry. I forget about the inline style properties. That relative property on that one td shouldn've have been there. Hmm, I wonder how it got there...Anyway, I removed it and it's working fine now.


    Thanks

  8. #8
    Join Date
    May 2002
    Posts
    10,943

    Re: AJAX Support Messed Up

    That's exactly the one that caught my eye right away. CSS was invented to replace the lack of table's abilities to truly stylize a page. Many CSS attributes, such as position, do not render tables correctly.

    By the way...thanks for the rating!
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured