Update panel affects menu element










0















I am using asp.net, webforms.
I have a real time clock, some images and a menu. For updating the clock I use an UpdatePanel, that is triggered by a timer Tick event. The problem is that the menu is also affected even it is not part of the UpdatePanel. More exactly, the sub-menu isn't working, therefore I can't acces any root's children.







 <div class="container body-content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmrClock" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Image ID="imgPub1" runat="server" ImageUrl="~/Images/UPT.png" />
<asp:Image ID="imgPub2" runat="server" ImageUrl="~/Images/UPT1.png" />
<asp:Label ID="lblClock" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57" Orientation="Horizontal" StaticSubMenuIndent="10px">
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<Items>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="Acasa" Value="Acasa"></asp:MenuItem>
<asp:MenuItem Text="Manipulare Date" Value="Manipulare Date">
<asp:MenuItem NavigateUrl="~/Contact.aspx" Text="Actualizare Date" Value="Actualizare Date"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Adaugare Angajati" Value="Adaugare Angajati"></asp:MenuItem>
<asp:MenuItem Text="Stergere Angajati" Value="Stergere Angajati"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Selectable="False" Text="Tiparire" Value="Tiparire">
<asp:MenuItem Text="Stat de Plata" Value="Stat de Plata"></asp:MenuItem>
<asp:MenuItem Text="Fluturasi" Value="Fluturasi"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Modificare Procente" Value="Modificare Procente"></asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticSelectedStyle BackColor="#5D7B9D" />
</asp:Menu>
</div>


Here is the OnTick code:



protected void Page_Load(object sender, EventArgs e)

if (!Page.IsPostBack)

lblClock.Text = DateTime.Now.ToLongTimeString();
imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";



protected void tmrClock_OnTick(object sender, EventArgs e)

Random rnd = new Random();
int rndNum = rnd.Next(0, 2);
if (rndNum == 0)

imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";

else

imgPub1.ImageUrl = "~/Images/UPT1.png";
imgPub2.ImageUrl = "~/Images/UPT.png";

lblClock.Text = DateTime.Now.ToLongTimeString();










share|improve this question
























  • Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?

    – dpant
    Nov 15 '18 at 14:56











  • Thank you for the update. Nevertheless, I still cannot emulate the problem. Everything works fine with your example. See for yourself (I've used two random country flags as images): i.imgur.com/O1KcS0m.gif

    – dpant
    Nov 18 '18 at 16:36












  • @dpant Thanks for trying the code, it's very strange, I have tried several browsers but the menu is still not working. It might be a config or a .NET problem on my side.

    – Vlad
    Nov 20 '18 at 15:10
















0















I am using asp.net, webforms.
I have a real time clock, some images and a menu. For updating the clock I use an UpdatePanel, that is triggered by a timer Tick event. The problem is that the menu is also affected even it is not part of the UpdatePanel. More exactly, the sub-menu isn't working, therefore I can't acces any root's children.







 <div class="container body-content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmrClock" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Image ID="imgPub1" runat="server" ImageUrl="~/Images/UPT.png" />
<asp:Image ID="imgPub2" runat="server" ImageUrl="~/Images/UPT1.png" />
<asp:Label ID="lblClock" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57" Orientation="Horizontal" StaticSubMenuIndent="10px">
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<Items>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="Acasa" Value="Acasa"></asp:MenuItem>
<asp:MenuItem Text="Manipulare Date" Value="Manipulare Date">
<asp:MenuItem NavigateUrl="~/Contact.aspx" Text="Actualizare Date" Value="Actualizare Date"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Adaugare Angajati" Value="Adaugare Angajati"></asp:MenuItem>
<asp:MenuItem Text="Stergere Angajati" Value="Stergere Angajati"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Selectable="False" Text="Tiparire" Value="Tiparire">
<asp:MenuItem Text="Stat de Plata" Value="Stat de Plata"></asp:MenuItem>
<asp:MenuItem Text="Fluturasi" Value="Fluturasi"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Modificare Procente" Value="Modificare Procente"></asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticSelectedStyle BackColor="#5D7B9D" />
</asp:Menu>
</div>


Here is the OnTick code:



protected void Page_Load(object sender, EventArgs e)

if (!Page.IsPostBack)

lblClock.Text = DateTime.Now.ToLongTimeString();
imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";



protected void tmrClock_OnTick(object sender, EventArgs e)

Random rnd = new Random();
int rndNum = rnd.Next(0, 2);
if (rndNum == 0)

imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";

else

imgPub1.ImageUrl = "~/Images/UPT1.png";
imgPub2.ImageUrl = "~/Images/UPT.png";

lblClock.Text = DateTime.Now.ToLongTimeString();










share|improve this question
























  • Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?

    – dpant
    Nov 15 '18 at 14:56











  • Thank you for the update. Nevertheless, I still cannot emulate the problem. Everything works fine with your example. See for yourself (I've used two random country flags as images): i.imgur.com/O1KcS0m.gif

    – dpant
    Nov 18 '18 at 16:36












  • @dpant Thanks for trying the code, it's very strange, I have tried several browsers but the menu is still not working. It might be a config or a .NET problem on my side.

    – Vlad
    Nov 20 '18 at 15:10














0












0








0








I am using asp.net, webforms.
I have a real time clock, some images and a menu. For updating the clock I use an UpdatePanel, that is triggered by a timer Tick event. The problem is that the menu is also affected even it is not part of the UpdatePanel. More exactly, the sub-menu isn't working, therefore I can't acces any root's children.







 <div class="container body-content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmrClock" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Image ID="imgPub1" runat="server" ImageUrl="~/Images/UPT.png" />
<asp:Image ID="imgPub2" runat="server" ImageUrl="~/Images/UPT1.png" />
<asp:Label ID="lblClock" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57" Orientation="Horizontal" StaticSubMenuIndent="10px">
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<Items>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="Acasa" Value="Acasa"></asp:MenuItem>
<asp:MenuItem Text="Manipulare Date" Value="Manipulare Date">
<asp:MenuItem NavigateUrl="~/Contact.aspx" Text="Actualizare Date" Value="Actualizare Date"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Adaugare Angajati" Value="Adaugare Angajati"></asp:MenuItem>
<asp:MenuItem Text="Stergere Angajati" Value="Stergere Angajati"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Selectable="False" Text="Tiparire" Value="Tiparire">
<asp:MenuItem Text="Stat de Plata" Value="Stat de Plata"></asp:MenuItem>
<asp:MenuItem Text="Fluturasi" Value="Fluturasi"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Modificare Procente" Value="Modificare Procente"></asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticSelectedStyle BackColor="#5D7B9D" />
</asp:Menu>
</div>


Here is the OnTick code:



protected void Page_Load(object sender, EventArgs e)

if (!Page.IsPostBack)

lblClock.Text = DateTime.Now.ToLongTimeString();
imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";



protected void tmrClock_OnTick(object sender, EventArgs e)

Random rnd = new Random();
int rndNum = rnd.Next(0, 2);
if (rndNum == 0)

imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";

else

imgPub1.ImageUrl = "~/Images/UPT1.png";
imgPub2.ImageUrl = "~/Images/UPT.png";

lblClock.Text = DateTime.Now.ToLongTimeString();










share|improve this question
















I am using asp.net, webforms.
I have a real time clock, some images and a menu. For updating the clock I use an UpdatePanel, that is triggered by a timer Tick event. The problem is that the menu is also affected even it is not part of the UpdatePanel. More exactly, the sub-menu isn't working, therefore I can't acces any root's children.







 <div class="container body-content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmrClock" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Image ID="imgPub1" runat="server" ImageUrl="~/Images/UPT.png" />
<asp:Image ID="imgPub2" runat="server" ImageUrl="~/Images/UPT1.png" />
<asp:Label ID="lblClock" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57" Orientation="Horizontal" StaticSubMenuIndent="10px">
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<Items>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="Acasa" Value="Acasa"></asp:MenuItem>
<asp:MenuItem Text="Manipulare Date" Value="Manipulare Date">
<asp:MenuItem NavigateUrl="~/Contact.aspx" Text="Actualizare Date" Value="Actualizare Date"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Adaugare Angajati" Value="Adaugare Angajati"></asp:MenuItem>
<asp:MenuItem Text="Stergere Angajati" Value="Stergere Angajati"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Selectable="False" Text="Tiparire" Value="Tiparire">
<asp:MenuItem Text="Stat de Plata" Value="Stat de Plata"></asp:MenuItem>
<asp:MenuItem Text="Fluturasi" Value="Fluturasi"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Modificare Procente" Value="Modificare Procente"></asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticSelectedStyle BackColor="#5D7B9D" />
</asp:Menu>
</div>


Here is the OnTick code:



protected void Page_Load(object sender, EventArgs e)

if (!Page.IsPostBack)

lblClock.Text = DateTime.Now.ToLongTimeString();
imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";



protected void tmrClock_OnTick(object sender, EventArgs e)

Random rnd = new Random();
int rndNum = rnd.Next(0, 2);
if (rndNum == 0)

imgPub1.ImageUrl = "~/Images/UPT.png";
imgPub2.ImageUrl = "~/Images/UPT1.png";

else

imgPub1.ImageUrl = "~/Images/UPT1.png";
imgPub2.ImageUrl = "~/Images/UPT.png";

lblClock.Text = DateTime.Now.ToLongTimeString();







asp.net webforms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 '18 at 10:32







Vlad

















asked Nov 13 '18 at 20:12









VladVlad

32




32












  • Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?

    – dpant
    Nov 15 '18 at 14:56











  • Thank you for the update. Nevertheless, I still cannot emulate the problem. Everything works fine with your example. See for yourself (I've used two random country flags as images): i.imgur.com/O1KcS0m.gif

    – dpant
    Nov 18 '18 at 16:36












  • @dpant Thanks for trying the code, it's very strange, I have tried several browsers but the menu is still not working. It might be a config or a .NET problem on my side.

    – Vlad
    Nov 20 '18 at 15:10


















  • Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?

    – dpant
    Nov 15 '18 at 14:56











  • Thank you for the update. Nevertheless, I still cannot emulate the problem. Everything works fine with your example. See for yourself (I've used two random country flags as images): i.imgur.com/O1KcS0m.gif

    – dpant
    Nov 18 '18 at 16:36












  • @dpant Thanks for trying the code, it's very strange, I have tried several browsers but the menu is still not working. It might be a config or a .NET problem on my side.

    – Vlad
    Nov 20 '18 at 15:10

















Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?

– dpant
Nov 15 '18 at 14:56





Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?

– dpant
Nov 15 '18 at 14:56













Thank you for the update. Nevertheless, I still cannot emulate the problem. Everything works fine with your example. See for yourself (I've used two random country flags as images): i.imgur.com/O1KcS0m.gif

– dpant
Nov 18 '18 at 16:36






Thank you for the update. Nevertheless, I still cannot emulate the problem. Everything works fine with your example. See for yourself (I've used two random country flags as images): i.imgur.com/O1KcS0m.gif

– dpant
Nov 18 '18 at 16:36














@dpant Thanks for trying the code, it's very strange, I have tried several browsers but the menu is still not working. It might be a config or a .NET problem on my side.

– Vlad
Nov 20 '18 at 15:10






@dpant Thanks for trying the code, it's very strange, I have tried several browsers but the menu is still not working. It might be a config or a .NET problem on my side.

– Vlad
Nov 20 '18 at 15:10













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288771%2fupdate-panel-affects-menu-element%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288771%2fupdate-panel-affects-menu-element%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線