Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Timer & Page refreshTimer & Page refresh
Previous
 
Next
New Post
5/31/2013 10:56 AM
 

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 

 

 

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Timer & Page refreshTimer & Page refresh


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out