Update panel affects menu element











up vote
0
down vote

favorite












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 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
    yesterday

















up vote
0
down vote

favorite












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 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
    yesterday















up vote
0
down vote

favorite









up vote
0
down vote

favorite











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 2 days ago

























asked Nov 13 at 20:12









Vlad

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 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
    yesterday




















  • Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?
    – dpant
    Nov 15 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
    yesterday


















Cannot replicate with the markup you've provided. Maybe you want to share the code of the OnTick event handler?
– dpant
Nov 15 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 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
yesterday






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
yesterday



















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',
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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


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

Ottavio Pratesi

Tricia Helfer

15 giugno