0

I use master-pages everywhere. They contain my menu with ImageButtons. They display fine, but on one page, the events are not firing, except for the help-button, which works. The page that doesn't work contains UpdatePanels.

ScriptManager on that page is set to AsyncPostBackTimeout="600".

How can I start resolving this issue? Here's some of my code from the masterpage:

 <div id="TopLinksDiv">
    <a href="#">
      <div id="HelpButton">
          <asp:ImageButton ID="imghelp" AlternateText="Help" ImageUrl="~/Resources/Images/FINALY_HelpBtn.png"
              runat="server" />
      </div>
    </a>
    <a href="#">
       <div id="HomeButton">
          <asp:ImageButton ID="imgHome" AlternateText="Home" ImageUrl="~/Resources/Images/FINALY_HomeBtn.png"
              runat="server" />
       </div>
    </a>
    <a href="#">
        <div id="ChangePWDButton">
            <asp:ImageButton ID="imgChangePwd" AlternateText="Change Password" ImageUrl="~/Resources/Images/FINALY_ChangePWD.png"
               runat="server" />
        </div>
    </a>
    <a>
       <div id="LogoutButton">
           <asp:ImageButton ID="imgLogout" AlternateText="LogOut" ImageUrl="~/Resources/Images/FINALY_LogoutBtn.png"
               runat="server" />
       </div>
Abel
  • 56,041
  • 24
  • 146
  • 247
JayOnDotNet
  • 398
  • 1
  • 5
  • 17
  • 1
    Sure someone can, but with this information? Not likely. – Ruben Dec 28 '11 at 11:10
  • i can give u the neccesary info. Help me – JayOnDotNet Dec 28 '11 at 11:16
  • What about the code of your menu? – Ruben Dec 28 '11 at 11:19
  • posted code of the menu in the master page. the same code working perfectly in every page except in one page having some update panels. – JayOnDotNet Dec 28 '11 at 11:24
  • 1
    Can you define "not working"? I.e., does it mean that if you do "View source" in your browser, the HTML is there (search for TopLinksDiv), but doesn't show, or does it mean that the code is not rendered at all? If the code is there, but the menu doesn't show, your problem is JS, CSS or HTML related. – Abel Dec 28 '11 at 11:26
  • every thing is displaying perfectly. But the navigation is not firing. If click home button need to navigate to home. its firing in every page but not in one page. – JayOnDotNet Dec 28 '11 at 11:30
  • @Jaya Prakash Rokkam So there is only 1 page were it is not working? – Ruben Dec 28 '11 at 11:32
  • yep... Couldnt find the bug because implementedt the same pattern here also – JayOnDotNet Dec 28 '11 at 11:33
  • Hey In that menu help button is working. others are not – JayOnDotNet Dec 28 '11 at 11:39
  • I edited your question to reflect your comments. If I missed something, please edit. I also made your code more readable. As you can now see, the logout button is missing an href-attribute (probably not causing your problem though) – Abel Dec 28 '11 at 11:41
  • @JayaPrakashRokkam , I would suggest you to check thoroughly the page where the button are not working. Sometimes a missing javascript or html tag does this kind of things. Just check your page for such inaccuracy. – Pankaj Upadhyay Dec 28 '11 at 11:45
  • ya.. for display purpose image embedded in hyperlink. but the On_Click event is running from the server side as Response.Redirect("~/Home.aspx"); So I couldnt understand why it is not firing. If Href is problem it should not fire for other pages. – JayOnDotNet Dec 28 '11 at 11:47
  • The code above also misses a tag you might wanna check if that's so with the original code aswell. – Ruben Dec 28 '11 at 11:57
  • Can you send full code file including master page and client pages both aspx and cs – Imran Rizvi Dec 28 '11 at 11:58
  • ya i vl post now please check this link once http://stackoverflow.com/questions/8644214/asp-net-master-page-image-buttons-not-working. u can find the the code on content page – JayOnDotNet Dec 28 '11 at 12:18
  • The code you have posted looks fine, you need to include more relevant code for people to be able to help you. – Hanlet Escaño Dec 28 '11 at 14:05
  • I'd check that page for JavaScript errors. In my experience, that is the most likely culprit. – Jeff Siver Dec 28 '11 at 17:59
  • Hi Code is so large in size.cannot post here. – JayOnDotNet Dec 29 '11 at 04:02

1 Answers1

0

Jaya,

By chance are you using the Ajax Control Toolkit? If so you will need to use their version of the script manager and not the .net ScriptManager. I ran into a similar issue that you are stating. If this is the case you would need to register the toolkit in your Master Page and add the Ssript manager like so.

//Other directives
<%@ 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
    </title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
  </head>
  <body>
    <form id="form1" runat="server">
      <asp:ToolkitScriptManager ID="tsmMaster" runat="server" />

    </form>
  </body>
</html>
gsirianni
  • 1,334
  • 2
  • 18
  • 35