How to fire a server side action after 10 minutes in ASP.NET using C#
For example of, if user creates an account and if his account is kept inactive for 12 hours how to automatically delete his account. I need something related to this kind of example.
There should be no relation with browser. Once the user logs out of his account his some server side action to be performed automatically after some certain time.
I must miss something obvious here when using htmlbegin form. I noticed that it takes (or tries to take me) right to the view rather than the an action. If I replace SearchAction with SearchResult is goes nicely to the view, not considering the action.
Using SeachAction leads to the error that it cant find the view.
I want to redirect the user after 2 mins if there is inactivity for 2 mins. I am not using ASP.NEt membership. And I dont want to use Sessiontimeout for this. Session timeout will logout the user even if he is working on the system. My objective is like screensaver process.
If there is no action for the specified time, the screensaver runs. Similarly, I want to redirect the user to login page.
note that i have already handled it with the following javascript:
[Code]....
Here what my problem is,
the user is working on the site...ok.. he want to see someother site.he browse someother site and works on....or even he can do some other work in his system...but he is active in his system... What this script does is, it automatically logout the user and redirect him to login page. But it should not do while he is active...IT SHOULD REDIRECT IF HE IS NOT ACTIVE REALLY (Similar to Screensaver process)
I'm implement Comet in Asp.net MVC, I used timer to keep Async request in server, Async request will complete when timer elapsed 1 minute and response to client (to avoid 404 error) and then reconnect to Async Controller. I also wanna execute some Synchronous action during Async request was holding, but the problem is: When an Async action was executed and hold by using timer, the Sync Action wasn't called until Async action (comet long-live request) completed. I did test with firefox 3.6 many times, but the result is the same, so strange, Do you know why ? I have a sub some questions : To implement comet, using timer (response after some minutes elapsed) or thread (response after several time sleeping thread) to hold async request, which is better?
I am desiging a master and details page from a search page..user can search for something and I need to display the result in jqgrid if the result has more than 1 row or record.. if the result is just one record then i have to directly send then to details page by skiping grid page... I do have an action method for results page and one more action method for Jqgrid data..i am trying to check the row count for the database result and trying to redirect to details action results..but its not working at all..and showing an empty jqgrid..
Lets say I have a simple controller for ASP.NET MVC I want to test. I want to test that a controller action (Foo, in this case) simply returns a link to another action (Bar, in this case).How would you test TestController.Foo? (either the first or second link)
My implementation has the same link twice. One passes the url throw ViewData[]. This seems more testable to me, as I can check the ViewData collection returned from Foo(). Even this way though, I don't know how to validate the url itself without making dependencies on routing.The controller:
public class TestController : Controller { public ActionResult Foo()[code].....
My httppost action doesnt seem to have received my model. The code is below;
[Code]....
i put a breakpoint on the line; return RedirectToAction("Error", "Dashboard"); and i found that appQualif carried no values whatsoever from the form i submitted..
I've been using Html.Action("ActionName", "ControllerName") to invoke child actions across controllers without needing to have the view in ViewsShared. This has been working great for displaying things like session or cookie information.
Instead of just accessing cookies, I would like to pass additional parameters to Html.Action("ActionName", "ControllerName") so the action can execute different code based on the the data passed to the original view.
Should I be using a different method to pass parameters to a child action in a different controller?
I'm trying to add file upload functionality to a page. I've got a form that posts the selected file to a controller with a 'savefile' method. But if I don't add a get version of 'savefile' I'll get a 404 error. Here is the form code which is presented on the Index page:
[Code]....
And here is the controller code:
[Code]....
Intuitively I don't think I should need a GET version of SaveFile but if omit it I get a 404 error when the form posts. Why should I need a GET version of SaveFile when all I want is to post a form and save the file?
I have a controller with a bunch of actions as such:
[Code]....
I'm looking for a way to find out which action invoked the other: for instance, when redirecting to Action1, I need to know whether it is coming from clicking "next" button at Action0 or clicking "back" button at Action2. This is is to avoid performing Action1 twice (My app is like a wizard, if I click back button at Action2, I don't want to execute Action1 again).
I'm a newbie into MVC and I am like only on chapter 7 in ASP.NET MVC Unleashed so be easy with m
[Code]....
how do I tell Create Button to send to an Action named Create and to Edit to an Action named Edit on the same form?I guess it is possible on ASP.NET MVC if it is possible on ASP.NET Webforms
I have a page with three partial views. On the first ascx, I want some data posted when a user clicks on "submit" button, and send that data to another POST action "search" and search the db with that data, the final output should be the view returned by "search". How do I do this?
I have Web Application in asp.net. Where I am maintaining Session for every User. And every Time I got logout in Approx 2 min. I tried to increase this time through web Config File upto 60 min but it is not working For me and I m getting same problem.
I have created A class file For maintaining session.I am Using This Code.
public static void createSession(System.Web.SessionState.HttpSessionState session) { Session = session; }
This is my class file code.
And I am calling this function in login Page load like this.
I'm having a problem with a web app I'm managing. Users starting receiving the following error occasionally:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
The problem is that it's not a cluster - it's a single Windows 2003 server. After digging around, it appears that adding a machineKey section and some extra attributes to the Pages directive in my web.config resolves this error:
After changing these two things in my web.config, the error goes away, but now I have a new problem - Instead of an error that my viewstate is invalid, the app just "Forgets" who my user is, and sends them back to the login page. Now, the users are browsing through the application, and then they're unexpectedly sent to the login page, even after they've already been logged in for a few minutes. While I can't force this to happen, it usually happens within visiting 10-12 different pages, so pretty frequently.
I'd love a resolution to this - does anybody know what else might be causing the viewstate error on a single server, or what I can do to ensure that it's validated properly?
I have implemented the basic forms authentication.In web.config I have set the following, in the authentication tagtimeout = "50000000000" Other than that, I have an out-of the box implementation.I have no custom provider.My clients want to pretty much enter the username once a day.The timeout is in minutes, so I am sure that they are not waiting over 5 million minutes,so something else has to be booting them.
If I do not activate my application for 30 minutes (my customers wants to be online all day without logging out) my session for user login is lost. How can I automatically refresh my sessions if there has been no activity for e.g. 10 minutes? It's a sort of keep-alive that I want. I thought the problem was sloved when I set the timeout to 100000 but it doesn't help
Note. My application works with the remember me function but it losses its sessions after 30 minutes.
I need some guidance on creating and running a Cron Job in asp.net(C#.net) to run my page every 30 minutes. My Web page has to load data from Sql Server to MySql database every 30 minutes with this cron job.
I'm building a website in ASP.NET with C# code behind files, I'll be using the site on shared hosting due to price, and one of my aims was to have a stored procedure scheduled to run every 1 hour in MySQL and update my database.
Unforunately security arrangements on shared hosting means that users cannot schedule stored procedures, so I decided to tackle the problem another way.
I created a timer in my website inside its own class file in the App_Code folder, it basically starts a timer and then the time elapsed event connects to my database and calls the stored procedure. I then built an admin page that allows me to see the status of this thread (started/stopped) and allows me to start/stop and restart it.
It's installed on my test site that I run from my home PC using Win7 and IIS, and it works beautifully, I can stop start the service and watch the database tick up when it's running...
HOWEVER...it only seems to run for 20 minutes before it stops, I thought maybe it was the garbage collection killing it since that's mentioned in some timer examples but I've added a GC.KeepAlive(Timer) and that's not . I'm really stumped as to what is stopping the timer, it's functionality is dead on the money and how I want it, but it just stops, always after almost exactly 20 minutes.