I have a button in ASP.Net Web Application. I want this button to invoke a task in task scheduler. I didn't find any exact code by which I could invoke a task from a task scheduler. Please Help....!!!
Run a specific task in Task Scheduler using ASP.NET C#
2.9k Views Asked by user2955299 At
2
There are 2 best solutions below
1
JGV
On
Here is a MSDN link: https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler(v=vs.110).aspx
Use TaskScheduler.TryExecuteTask Method for your case.
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in ASP.NET
- Create an IIS web request activity light
- Writing/Overwriting to specific XML file from ASP.NET code behind
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- Getting deeply embedded XML element values
- What is best way to check if any of the property of object is null or empty?
- NuGet - Given a type name or a DLL, how can I find the NuGet package?
- ASP-MVC Code-first migrations checkbox not active
- How do i add onclient click to my jquery button
- Jquery: Change contents of <select> tag dynamically
- Retrieving data from Oracle database
- ASP.NET: Fill Textbox field upon dropdownlist selection by user
- Why web API return 404 when deploy to IIS
Related Questions in SCHEDULED-TASKS
- Error while Running a .exe file using coldfusion schedule task
- Repetition Task C# Server side
- scheduling and editing an event to occur at a specific time android
- Looking to run automated jobs in .NET application
- scheduling with cronjob to run the php file for only one time
- Scheduling java process for a specific time interval with a given delay
- Why can't I create a scheduled task with PHP exec()?
- Scheduling multiple instance of a single java process
- C# Console App Exit Code with Task Scheduler
- Php schedule run a function after 10 minutes
- .BAT file not running in task scheduler
- Running a python background script (Windows 7) to keep files updated
- Java: scheduling task execution once a month (or two)
- Java Schedule a task for single execution
- Automate MySQL backup @localhost with mysqldump in Windows 8
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Have a look at the documentation for this library. It is a wrapper for Windows Task Scheduler.
http://taskscheduler.codeplex.com
which is a wrapper for Task Scheduler Windows API https://msdn.microsoft.com/en-us/library/windows/desktop/aa383614(v=vs.85).aspx
using this wrapper you can interact with the task scheduler easily with code like this
now you should remember that you can not poll the status of the task while you are holding up the ASP.NET request processing cycle. Probably the best you can do is checking the status in Ajax calls until the task is finished.
Meanwhile re-evaluate your design and the suitability of the task scheduler for this purpose. Securing your website while allowing access to task scheduler might be a challenge. One other option would be a Windows Service that you develop and runs requested tasks for the Web application. This has always worked perfectly for me. The client can be ASP.NET AJAX or JavaScript getting the status of the task through Web API