简体   繁体   English

如何使用ASP.NET MVC自动创建每日表单

[英]How to create daily forms with ASP.NET MVC automatically

I have a web project with some forms in it. 我有一个带有某些表单的Web项目。 Every user on my web project should get an empty form ready to fill for everyday. 我的Web项目中的每个用户都应该准备一个空表格,以便每天填写。

Is there anyway to Create a simple empty form with only id , name , activity fields, all automatically done by server everyday in MVC? 无论如何,有没有创建一个仅包含idnameactivity字段的简单空表单,所有表单每天都由服务器在MVC中自动完成?

It can be timer that watches system time and creates a new form when a new day beguns or it can be another trick that i cant even think of. 它可能是监视系统时间并在新的一天开始时创建新表格的计时器,或者它可能是我什至无法想到的另一个技巧。

Just show me ways to create forms every new day automatically. 请教我如何每天自动创建表单。

Why not just check if a form has already been submitted by the user on that day and display the form if they haven't. 为什么不检查用户当天是否已提交表单,并显示该表单(如果尚未提交)。 You could hold the date in a hidden field on the form 您可以将日期保留在表单的隐藏字段中

Implementing scheduled tasks in ASP.NET is hard . 在ASP.NET中实现计划任务很困难 If your only goal is to create new rows in a database table, use a SQL Server Job (assuming you have SQL Server). 如果您的唯一目标是在数据库表中创建新行,请使用SQL Server作业 (假设您有SQL Server)。

If it's more complex than that (sending email, for example), you have a few options presented in the answers in the linked question. 如果比这更复杂(例如,发送电子邮件),则链接问题的答案中会提供一些选项。 I would typically create a simple console application and schedule it with the Windows Task Scheduler, but it depends on the scope of the task. 我通常会创建一个简单的控制台应用程序,并使用Windows Task Scheduler对其进行调度,但这取决于任务的范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM