• Safari + UpdatePanel + Panel + CalendarExtender, change Panel visible


    Hi all,

    This is the code that's not working in Safari 4: 

    <%@ Page Language="C#" AutoEventWireup="true" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    
    <!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" >
    
        <script runat="server" >      
            void ddlPeriodSelection_SelectedIndexChanged(object sender, EventArgs e)
            {
                if (ddlPeriodSelection.SelectedValue != "Time_period")
                {
                    pnlTimePeriodSelection.Visible = false;
                }
                else
                {
                    pnlTimePeriodSelection.Visible = true;
                }
            }      
       </script>
    
    <head id="Head1" runat="server">
        <title>Untitled Page</title>    
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div> 
                    How long connection should be available? 
                                       
                   <asp:DropDownList ID="ddlPeriodSelection" runat="server"  
                        onselectedindexchanged="ddlPeriodSelection_SelectedIndexChanged" AutoPostBack=true>
                        <asp:ListItem Value="One_day" Text="Today" />                               
                        <asp:ListItem Value="Time_period" Text="Select date" />
                  </asp:DropDownList>
                        
                  <asp:Panel runat="server" ID="pnlTimePeriodSelection" Visible="false"> 
                    Please select exact date:          
                    <asp:TextBox runat="server" ID="tbDateFrom" Width="70px" />            
                    <ajaxToolkit:CalendarExtender ID="calendarButtonExtenderFrom" runat="server" TargetControlID="tbDateFrom" />
                 </asp:Panel>                  
                       
                    </div>
                </div>
            </ContentTemplate>
            </asp:UpdatePanel>
        </form>
    </body>
    </html>

    After the selection of second option it stops refresh updatepanel. Calendar is also not rendered.

    Could someone suggest how can i fix it ?

    Thanks

    ------------------------------------

    I put the following in a separate .js file:

    Sys.Browser.WebKit = {}; //Safari 3 is considered WebKit
    if (navigator.userAgent.indexOf('WebKit/') > -1) {
        Sys.Browser.agent = Sys.Browser.WebKit;
        Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
        Sys.Browser.name = 'WebKit';
    }

    I then referenced the script on the masterpage where the control is located:

    <script type="text/javascript" language="javascript" src="/Workarea/java/webkit.js"></script>

    http://forums.asp.net/t/1413064.aspx

    Solution is here http://forums.asp.net/p/1252014/2392110.aspx

  • 相关阅读:
    HTML5之Canvas影片广场
    iOS英语—》中国本土化,如调用专辑,摄像头的变化“cancel”,“photos”至“撤消”,“摄像头”
    约瑟夫问题解决
    2014在百度之星资格赛的第二个问题Disk Schedule
    2015第30周二
    2015第30周一
    2015第29周日
    2015第29周六Spring
    2015第29周五AOP
    2015第29周四
  • 原文地址:https://www.cnblogs.com/emanlee/p/1672126.html
Copyright © 2020-2023  润新知