开发者

asp:Button execute problem in IE

<asp:Button ID="btnFind" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, SearchButtonText %>" CssClass="submit" 
                OnClick="btnFind_Click" ValidationGroup="TopSearch" />

but btnFind_Click never executed in IE. It work in FF and in Opera. Problem is only in IE. Maybe anyone know where can be problem that btnFind_Click can not executed when i click on it?

EDIT:

i figure out that asp:linkbutton works, problem is only in asp:button

EDIT 2:

code:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SearchPage.master.cs"
    Inherits="ViaMura.Web.MasterPage.SearchPage" %>
<!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">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <asp:ContentPlaceHolder ID="cpDescription" runat="server">
    </asp:ContentPlaceHolder>
    <asp:ContentPlaceHolder ID="cpKeywords" runat="server">
    </asp:ContentPlaceHolder>
    <meta name="copyright" content="&copy; 2010 viamura.si" />
    <meta name="robots" content="index,follow" />
    <meta name="rating" content="General" />
    <link href="~/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <link href="~/css/results.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="~/css/map.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="~/css/weather.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="~/css/sexyalertBox.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="/js/jQuery/jquery.1.3.1.min.js"></script>    
    <script type="text/javascript" src="/js/jQuery/jquery.easing.1.3.js"></script>
    <script type="text/javascript" src="/js/jQuery/jquery.sexyalertbox.1.2.js"></script>
    <script type="text/javascript" src="/js/display.js"></script>
    <script type="text/javascript" src="/js/animatedCollapse.js"></script>
    <script type="text/javascript" src="/js/jQuery/jquery.ajaxConten.2.1.js"></script>
    <asp:Literal ID="litIE6" runat="server" Text=""></asp:Literal>
    <asp:ContentPlaceHolder ID="cpHead" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body onload="load();"> 
    <form id="form1" runat="server" DefaultButton="btnFind">
    <asp:ScriptManager ID="smSearchPage" runat="server" EnablePageMethods="true">        
    </asp:ScriptManager>
    <asp:UpdatePanel ID="upnDefault" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:Literal ID="litHiddenFields" runat="server"></asp:Literal>
    <div id="top_menu">
        <asp:HyperLink ID="hlHome" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, HomeTopButtonText %>" NavigateUrl="~/Default.aspx"></asp:HyperLink>
        · <asp:HyperLink ID="hlAddSite" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, AddSiteTopButtonText %>" NavigateUrl="~/EnterSite.aspx"></asp:HyperLink>
        · <asp:HyperLink ID="hlAbout" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, AboutTopButtonText %>" NavigateUrl="~/About.aspx"></asp:HyperLink>
        · <asp:HyperLink ID="hlHelp" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, HelpTopButtonText %>" NavigateUrl="~/Help.aspx"></asp:HyperLink>
        · <asp:HyperLink ID="hlMarketing" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, MarketingTopButtonText %>" NavigateUrl="~/Marketing.aspx"></asp:HyperLink>
        · <asp:HyperLink ID="hlInfo" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, InfoTopButtonText %>" NavigateUrl="~/Info.aspx"></asp:HyperLink>       
    </div>
    <div id="search_container">
        <a id="logoLink" runat="server"><img src="/images/results_logo.png" class="image" alt="viamura" /></a>
        <div id="search">
            <div id="tabs">
            <ul>              
                <li>
                    <div ID="btnWebL" runat="server" class="left_selected"></div>
                    <asp:LinkButton ID="btnWeb" runat="server" CssClass="center_selected" OnClick="btnWeb_Click"
                        Text="<%$ Resources:ViaMura.Web.Default, WebSearchButtonText %>"></asp:LinkButton>
                    <div ID="btnWebR" runat="server" class="right_selected"></div>
                </li>
                <li>
                    <div ID="btnMapL" runat="server" class="left"></div>
                    <asp:LinkButton ID="btnMap" runat="server" CssClass="center" OnClick="btnMap_Click"
                        Text="<%$ Resources:ViaMura.Web.Default, MapSearchButtonText %>"></asp:LinkButton>
                    <div ID="btnMapR" runat="server" class="right"></div>
                </li>
                <li>
                    <div ID="btnWeatherL" runat="server" class="left"></div>
                    <asp:LinkButton ID="btnWeather" runat="server" CssClass="center" OnClick="btnWeather_Click"
                        Text="<%$ Resources:ViaMura.Web.Default, WeatherSearchButtonText %>"></asp:LinkButton>
                    <div ID="btnWeatherR" runat="server" class="right"></div>
                </li>
                <li>
                    <div ID="btnImagesL" runat="server" class="left"></div>
                    <asp:LinkButton ID="btnImages" runat="server" CssClass="center" OnClick="btnImages_Click"
                        Text="<%$ Resources:ViaMura.Web.Default, PicturesSearchButtonText %>"></asp:LinkButton>
                    <div ID="btnImagesR" runat="server" class="right"></div>
                </li>
                <li>
                    <div ID="btnConverterL" runat="server" class="left"></div>
                    <asp:LinkButton ID="btnConverter" runat="server" CssClass="center" OnClick="btnConverter_Click"
                        Text="<%$ Resources:ViaMura.Web.Default, ConverterSearchButtonText %>"></asp:LinkButton>
                    <div ID="btnConverterR" runat="server" class="right"></div>
                </li>
            </ul>
            </div>
            <img src="/images/bg_search_med_left.png" align="left" alt="&lt;" /><asp:TextBox ID="txtFind"
                runat="server" CssClass="search" ValidationGroup="TopSearch"></asp:TextBox>
            <img src="/images/bg_search_med_right.png"
                    align="left" alt="&gt;" />                    
            <asp:LinkButton ID="btnFind" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, SearchButtonText %>" CssClass="submit"
                OnClick="btnFind_Click" ValidationGroup="TopSearch" />                  
            <div class="validation_error">
                <asp:RequiredFieldValidator ID="rfvtxtFind" runat="server" 
                    ErrorMessage="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, RequiredFieldTextOnSearchButton %>" ControlToValidate="txtFind" CssClass="validator" 
                    ValidationGroup="TopSearch" Display="Dynamic"></asp:RequiredFieldValidator>
            </div>
        </div>
        <div id="hints">
            <asp:Literal ID="litSuggestedForms" runat="server"></asp:Literal>
        </div>
        <hr />
    </div>
    <div id="results">
        <asp:ContentPlaceHolder ID="cplResults" runat="server">
        </asp:ContentPlaceHolder>
        <div id="results_search">
            <img src="/images/bg_search_sml_left.png" align="left" alt="&lt;" /><asp:TextBox ID="txtSmallSearch"
                runat="server" CssClass="search" ValidationGroup="BottomSearch"></asp:TextBox>
        <img src="/images/bg_search_sml_right.png" align="left" alt="&gt;" /> 
        <asp:Button ID="btnSmallFind" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, SmallSearchButtonText %>"
            CssClass="submit" onclick="btnSmallFind_Click" ValidationGroup="BottomSearch" />                 
        </div>    
        <div class="validation_error">
            <asp:RequiredFieldValidator ID="rfvtxtSmallSearch" runat="server" 
                    ErrorMessage="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, RequiredFieldTextOnSmallSearchButton %>" ControlToValidate="txtSmallSearch" 
                    ValidationGroup="BottomSearch" Display="Dynamic"></asp:RequiredFieldValidator>           
        开发者_如何学Python</div>
    </div>
    <div id="sidebar">
        <asp:Repeater ID="rptItems" runat="server">
            <HeaderTemplate>
            </HeaderTemplate>
            <ItemTemplate>
                <div class="item">
                    <a href='<%#Eval("Url")%>' target="_blank" ID="imageLink" class="image" runat="server"><img src='<%#GetImage(Eval("idAdvertisementCompanies"))%>' ID="imageSrc" runat="server" height='<%# Convert.ToInt32(Eval("Height"))%>' width='<%# Convert.ToInt32(Eval("Width"))%>' alt="img" align="left" /></a>
                    <p class="name"><asp:Label ID="lblName" runat="server" Text='<%#Eval("Name")%>'></asp:Label></p>        
                    <p><asp:Label ID="lblDescription" runat="server" Text='<%#Eval("Description")%>'></asp:Label></p>        
                </div>
            </ItemTemplate>
            <FooterTemplate>
            </FooterTemplate>
        </asp:Repeater>     
        <div class="item" style="border: none; margin: 0;">
            &nbsp;
        </div>
        <div class="top_search">
            <h2><asp:Label ID="lblPaidMostPopularSearches" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, FrequentlySearchedQueriesText %>"></asp:Label></h2>
            <ul>
                <asp:Literal ID="litPaidMostPopularSearches" runat="server"></asp:Literal>
            </ul>
        </div>
        <div style="clear: both; "></div>
        <br /><br />
        <div class="top_search">
            <h2><asp:Label ID="lblPaidTopSearches" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, PaidTopSearchesText %>"></asp:Label></h2>
            <ul>
                <asp:Literal ID="litPaidTopSearch" runat="server"></asp:Literal>
            </ul>
        </div>
    </div>
    <div id="footer">
        <div>
            <% /*<asp:LinkButton ID="lbSlo" runat="server" CssClass="slo"
                Text="" onclick="lbSlo_Click"></asp:LinkButton>            
            <asp:LinkButton ID="lbDeu" runat="server" CssClass="deu"
                Text="" onclick="lbDeu_Click"></asp:LinkButton>  
            <asp:LinkButton ID="lbAus" runat="server" CssClass="aus"
                Text="" onclick="lbAus_Click"></asp:LinkButton>*/ %>
            <a href="http://www.viamura.si" class="slo"></a>
            <a href="http://www.viamura.de" class="deu"></a>
            <a href="http://www.viamura.at" class="aus"></a>
        </div>
        <asp:HyperLink ID="hlInfoButtomLink" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, InfoButtomLinkText %>" NavigateUrl="~/Info.aspx"></asp:HyperLink>
         · 
        <asp:HyperLink ID="hlAboutButtomLink" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, AboutButtomLinkText %>" NavigateUrl="~/About.aspx"></asp:HyperLink>
         · 
        <asp:HyperLink ID="hlMarketingButtomLink" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, MarketingButtomLinkText %>" NavigateUrl="~/Marketing.aspx"></asp:HyperLink>        
        <br />
        <asp:Literal ID="litFooter" runat="server" Text="<%$ Resources:ViaMura.Web.MasterPage.SearchPage, FooterText %>"></asp:Literal>         
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-3307705-3']);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
</body>
</html>


Execution of code is browser independent, unless you have code that executes differently according to some user variable such as user agent.

So the problem is highly likely to not be on the server side.

Take a look at any Javascript you have that IE might be blocking the post for some reason. If there are script errors on the page, it can cause this possibly.


Take a look at this link : DoPostBakcWithOptions

The problem could be the js function WebForm_DoPostBackWithOptions served by the WebResource.axd and for some reason the HTTPModule could interfere with the handler.

Try to remove the HTTPModule and check if the button do PostBack.


found solution if anyone has similar problem. IE and opera have problems when you have more than 1 form and they don't know which one execute. STRANGE IE!!!

LINK where i found help: http://forums.asp.net/t/1035522.aspx/1?Submit+buttons+not+working+in+IE

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜