.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Timer in asp.net via VB

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net
 

Hi,

Is there any possibility to use Timer in Background of asp.net page? I need to always run the timer to monitor one field of table.

I was thinking to develop a small desktop application and run always on server, but it looks ugly idea if such kind of service can be done via asp.net it selef.

Please provide your ideas how it can be done?


Thank You





View Complete Post


More Related Resource Links

Url rewrite with timer

  

Hi,

I'm trying to rewrite my urls, which kinda work now.

The problem is that in my page i'm using a timer to refresh the data every couple of seconds.
But in Mozilla firebug I can see that the url keeps changing: it's getting bigger after each timer update, like this:

/categorie/1/attractie_parken?id=1&title=attractie_parken
/categorie/1/attractie_parken?id=1&id=1&title=attractie_parken&title=attractie_parken 
/categorie/1/attractie_parken?id=1&id=1&id=1&title=attractie_parken&title=attractie_parken&title=attractie_parken 

etc etc, until it returns a 404 not found.

What can I do to prevent this?

Thanks


Timers: Comparing the Timer Classes in the .NET Framework Class Library

  

Timers often play an important role in both client applications and server-based components (including Windows services). Writing effective timer-driven managed code requires a clear understanding of program flow and the subtleties of the .NET threading model. The .NET Framework Class Library provides three different timer classes: System.Windows.Forms.Timer, System.Timers.Timer, and System.Threading.Timer. Each of these classes has been designed and optimized for use in different situations. This article examines the three timer classes and helps you gain an understanding of how and when each class should be used.

Alex Calvo

MSDN Magazine February 2004


Erro While Creating a Solution Package With a timer Job

  

Hi All,

I am trying to create a test Timer job in SharePoint and want it to be deployed as a solution package. I am using a web application project and added Timerjob.cs, fetaurereceiver.cs, feature.xml and manifest.cml files in in. Then I created a .dff file to arrange the solution package. But when I tried to create a solution package with makecab.exe i got the below error

100.00% flushing current folder

I dont know what to do with that . Please if anyone can send me an example where a timer job was deployed as a solution package it will be of great help

Thanks,

 

 


Isha kapoor My SharePoint Blog Follow me

causing 500 server error :(

  

So, I'm just learning ASP.NET with C#, but this code just makes the page display a "500 - server error page"


the webpage is here: hereswhereyourewrong.net/aspnettest.aspx


the code is as follows:


<%@ Page Language="C#" AutoEventWireup="true" %>
<!-- This program throws up an Error 500: Server Error -->
<!-- I'm not sure why, it compiles just fine. -->
<!-- The last time it was because I had asp:TextBox fields not in a form -->
<!-- but here I just don't know -->
<html>
    <head runat="server" >
        <title>ASP.NET With C# Test</title>
        
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                timeText.Text = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss");
            }

            public void updateTime(object sender, EventArgs e)
            {
                timeText.Text = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss");
            }
        </script>    
    </head>
    <body>
        <div style="text-align: center;">
            <form runat="server" ID="timerForm">
                <asp:ScriptManager ID=

Timer delay

  
Hi guys, Please can one of you help me out. I have a bit of a trouble with the timer, it delay of 10 seconds which it should be of 5 seconds when I started the timer.   here it is the code Public Class Form1 Dim cPos As Point Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cPos = Windows.Forms.Cursor.Position End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Me.Panel1.ClientRectangle.Contains(Me.Panel1.PointToClient(Windows.Forms.Cursor.Position)) Then Me.Panel1.Show() If Panel1.Visible = True Then Timer1.Interval = 5000 Timer1.Start() Dim nPos As Point = Windows.Forms.Cursor.Position If cPos <> nPos Then cPos = nPos Else MessageBox.Show("mouse NOT moved in last 5 secs.") Panel1.Visible = False Timer2.Enabled = True End If End If End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim nPos As Point = Windows.Forms.Cursor.Position If cPos <> nPos Then cPos = nPos If Panel1.Visible = False Then If Me.Panel1.ClientRectangle.Contains(Me.Panel1.PointToClient(Windows.Forms.Cursor.Position)) Then Panel1.Visib

Timer usage in a class library

  
Hi all,     I have a class library, inside a class of this library i want to use a timer, such that for every one second a slot should be called. The code for this is as follows: </>public void OnDataReceive() { System.Windows.Forms.Timer t1 = new System.Windows.Forms.Timer(); t1.Enabled = true; t1.Interval = 500; t1.Start(); t1.Tick += new EventHandler(t1_Tick); }   public void t1_Tick(object sender, EventArgs e) { OnReceive(); }   But it is not reaching to this function itself "t1_Tick", Could some one tell me what is wrong in this??? Thanks for any help

Countdown Timer for Fantasy League Draft Site

  
I am looking to do a countdown timer for time remaining to make a draft pick.  I have seen a number of countdown timers such as: Timer1 Timer2 Timer3In all of these timers, I'm not seeing an easy way to change the Target Date via the code behind.  The timer would need to be reset after a user makes a draft pick.I also would like the timer to be server side as opposed to client side.Any help would be appreciated.

Custom SharePoint Timer Job doesn't run after changing code and restart timer services.

  
Hi We are facing an issue that our custom SharePonit Timer Job doesn't run after a changing the code. First, we developed and deployed a timer job. It worked fine for a few days, then we detected a memory leak and killed the OWSTIMER.EXE. (Maybe we should uninstall the timer job and restart the timer services nicely). We fixed the problem, redeployed the fix as a feature (assemblies are re-GACed ...) to our small SharePoint farm (one web server, one services server), restarted the SharePonit Timer Services. Now we can see the time job in Timer Job Definition in Central Admin but the job never runs (Since it doesn't run, the timer job status page doesn't have any info about it). We tried the same process in a dev environment with SharePoint signle box installation. The timer job just works fine. I did some search on Internet and followed some instruction to clear the cache from "C:\ProgramData\Microsoft\SharePoint\Config\1d50d73c-9bf1-4444-85a9-910ed050d1bf" by 1. Remove all the xml2. Clear the cache.ini with "1".3. restart the timer services. It still doesn't fix the problem.Please advise what else I can do. I even rename the timer job and redeploy it. It doesn't help. I checked the even log and SharePoing log and couldn't see anything wrong. Our OS is W2K8.         public override void FeatureActivated(SPFeatureReceiverProperties properties)        { 

Timer in Web Service

  
Hi I have a web service (asmx). I want to add a functionality where in I have to do polling for data on a URL. I added a timer and in the timer elapsed event handler I am checking for the data. Is it a good design? Is there something better than timer for this in ASP.NET? I have a issue with this where in the site / IIS goes in ideal state because of no requests, I have posted it in other forum on how to solve this problem. What I wanted to verify is that, use of timer is a valid thing for my use case, or I should go for some other approach? Will it be too heavy operation for the service to have a timer of 5 minutes interval running in over there, which will be running for the lifetime of this application.  

Change the Timer Service Account

  
I did an install with Sharepoint 2010 RTM and have it working well but when I checked the Monitoring - Review Problems and solutions it states a security concern that the Farm Account should not be used for other services.  At this stage I have to change out the timer service since it is using the farm account.  But I don't see the timer service in the "Security - Manage service Accounts" location.  I created a timer account with no problems but how does one go about changing the timer service to use this account?  I know I can go to services and change it there but I am wondering if there is a need to do this within Sharepoint?  Am I missing a credential management piece that did not show up in the list of services? Any help would be appreciated Workerbee09  By the way, The problem points to a failing service SPTimerService (SPTimerV4) but its started and working cause I can see services being started and history of the service where it was successfull. 

Change the Timer Service Account

  
I did an install with Sharepoint 2010 RTM and have it working well but when I checked the Monitoring - Review Problems and solutions it states a security concern that the Farm Account should not be used for other services.  At this stage I have to change out the timer service since it is using the farm account.  But I don't see the timer service in the "Security - Manage service Accounts" location.  I created a timer account with no problems but how does one go about changing the timer service to use this account?  I know I can go to services and change it there but I am wondering if there is a need to do this within Sharepoint?  Am I missing a credential management piece that did not show up in the list of services? Any help would be appreciated Workerbee09  By the way, The problem points to a failing service SPTimerService (SPTimerV4) but its started and working cause I can see services being started and history of the service where it was successfull. 

Critical Error with User Profile synchronization timer job

  
Hello! We are currently running SharePoint 2010 on Windows 2008 R2 servers. Our User Profile Service and User Profile Sync Service are currently running, and profile imports work fine when kicked off from Central Admin. However, the profile sync timer job always fails with the following Application Event error: Event 6398, SharePoint Foundation The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID 340e8ca2-6f3b-4bd8-80f2-0fe011709805) threw an exception. More information is included below. Generic failure Looking at the ManageUserProfileServiceApplication.aspx log, indeed the only imports visible are ones which have been kicked off manually in Central Admin. The failed scheduled imports are not even recorded to this log. The ULS entry associated with this error is as follows: 08/31/2010 17:11:17.32  OWSTIMER.EXE (0x0CD0)                    0x0C04 SharePoint Foundation          Timer                          6398 Critical The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID 340e8ca2-6f3b-4bd8-80f2-0fe

custom timer job Access denied sharepoint 2010

  
Hi, I have a question regarding to custom timer job will be happy if you could help us. The problem is that - owstimer.exe running the timer job crashes. - Question why? Launch debugg in the feature - running the timer job is falling on taskJob.Update (); writes SecurityException  I developed the Job TIMER on moss2007 that everything worked, Now we turned from 2007 to sharepoint 2010 and Job TIMER does not work. I tried to note all of the code is inside the function Execute in  job timer might have something to code blocks. But it also did not help. Eventvwr he writes in the following error: The description for Event ID 0 from source Application can not be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: Custom Timer Jobs: func FeatureActivated Access denied. the message resource is present but the message is not found in the string / message table what the solution to that-timer job that will work? Thank you Moshes

Why ASP.Net AJAX Timer control stops ticking when we right click on the page?

  
Asp.Net AJAX Timer control stops ticking when I right click on the page. Actually i am updating a label using timer control for every second. When I right click on the page the label is not getting updated. I mean the timer stops ticking. Please tell me what is actually happening and how can i resolve it.

two ajax needs - first timer

  
Hello,I have not used ajax yet. I use both VS 2008 and VS 2010. I have the ajax control toolkit installed. There are two primary things I need ajax for:1. visual feedback that a search is running. I've seen this on many apps, I need the whole page to be dimmed, and some simple animation to play indicating work is being done.2. I need to setup a master/detail view where when a user selects a row from the master datagrid, the detail view (either a formview or a detailview control, not sure which yet) will appear below it showing the further detail info of that selected row, without full page postback. I will actually have a few different 'detail view' controls, because depending on the type of record they select from the parent datagrid control, the detail view will have a different set of data, as in different schema, not just a different record. So I will need to check the 'type' of record selected in the parent, and then dynamically show the appropriate detail data in the appropriate detail view control. Again, no full page postback, and the same visual indication that work is being done like in my number 1, only this time just showing a simple animation in the section below the parent grid where the detail data is soon to appear, not the full page dimming thing.Those are my two goals. I'm completely new to ajax. Could someone let me know which ajax con

Timer job intiation error: SharePoint cannot deserialize an object of type

  
Hi All, when i run a timer job (One-Time timer) it has added it to Timer Job definitions in the Central Administration. I have checked the Log file in 12 hive and found the following error..... "SharePoint cannot deserialize an object of type xyz.xyzJob, xyzTimer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<token> on this machine. This typically occurs because the assembly containing this type is not installed on this machine. In this case, this message can be safely ignored. Otherwise, the assembly needs to be installed on this machine in a location that can be discovered by the .NET Framework." The above error says that the assembly is not added.... but it has been already added to the GAC. Can anyone guide me about the issue and how to resolve that........?

Dynamic Timer

  
Hi, I'm current working on developing an online examination system. I'm just wondering if anyone can point me to the right direction. I need to show a dynamic timer which indicates how many hours/minutes are remaining in the exam. For example, when the test starts, it would be at 4 hours so i would like to see something like this:Time Remaining: 4:00 As the test goes on, i want the timer to dynamically decrease in time and eventually will reach 0:00. Can anyone shed some light on this? Thanks in advance.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend