Dear All
I made a module in this i use timer every thing is working fine but the browser page is moving up or moving down when the timer execute. For example if a open the site and from the top of the page i scroll down automatically the page moves up when the interval refresh or if i make the page down then and stay there 3 min and then move up then automatically page will scroll down when the interval run...
As a confirmation i delete this module then this problem was resolved any one have an idea about it ?
here is my code
ASCX code
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="shoppingCartStatus.ascx.cs" Inherits="VIC_Complete_Project.Modules.ShoppingCart.shoppingCartStatus" %>
<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>
<asp:timer id="Timer1" runat="server" ontick="Timer1_Tick" interval="3000" viewstatemode="Enabled">
</asp:timer>
<asp:updatepanel id="UpdatePanel1" runat="server">
Shopping cart details : <asp:label id="Label2" runat="server" text="Label"></asp:label> Items » $<asp:label id="Label1" runat="server" text="Label"></asp:label>
<asp:button id="Button1" runat="server" text="View Cart" class="viewCartButton">
onclick="Button1_Click"/>
</asp:button>
<asp:asyncpostbacktrigger controlid="Timer1" eventname="Tick">
</asp:asyncpostbacktrigger>
</asp:updatepanel>
Code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Common;
namespace VIC_Complete_Project.Modules.ShoppingCart
{
public partial class shoppingCartStatus : DotNetNuke.Entities.Modules.PortalModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
private void loadMiniCartAmount()
{
try
{
UDF mydb = new UDF(); // my own class
DataTable dt;
string spName = "vic_cart_miniCart";
string[] field = new string[1];
string[] fieldValue = new string[field.Length];
field[0] = "@userRefName";
fieldValue[0] = Session["orderRefId"].ToString();
dt = mydb.loadDataTable(spName, field, fieldValue);
Label1.Text = dt.Rows[0]["amount"].ToString();
Label2.Text = dt.Rows[0]["totalProducts"].ToString();
}
catch
{
Label1.Text = "0";
Label2.Text = "0.00";
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
loadMiniCartAmount();
}
protected void Button1_Click(object sender, EventArgs e)
{
UDF myUdf = new UDF();
int myTabId = myUdf.findPageTabId("VIC-Card-shoppingCart", this.PortalId);
Response.Redirect(Globals.NavigateURL(myTabId));
}
}
}
The code is working fine just it moving the page up or down as per the timer