I currently have a web form built in Visual Web Developer with c# code behind. The user fills in the form and when they click submit the results are wrote to an Excel spreadsheet.
We are getting issues were users are submitting the form multiple times which is causing problems when analysing the spreadsheet data.
What I would like to do is have the form 'lookup' the spreadsheet and see if there has been a submission in the past 4weeks. If so it would then display that information to the user saying something like 'You cannot submit the form because an entry was made on dd/mm/yyy'
Could anyone tell me if this is possible? if not the excel lookup maybe a constraint on the submit button to allow each user to only submit once a month?
All ideas are welcome!
Here is the code behind;
public partial class WebForm36 : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void Submit_Click(object sender, EventArgs e)
string username = Request.ServerVariables["LOGON_USER"].ToString().Split('\\');
globalfunctions getAttribute = new globalfunctions();
//Build comma seperated line
string responseline = username.Remove(3);
responseline = responseline + "," + getAttribute.getADattribute(username, "displayName");
responseline = responseline + "," + completedBy.Text;
responseline = responseline + "," + jobTitle.Text;
responseline = responseline + "," + checkComp.Text;
responseline = responseline + "," + DateTime.Now;
//append to csv file
StreamWriter sw = File.AppendText("e:\\results\\StockRotation4W.csv");