Issue Using Winforms MessageBox in ASP.NET

tibelmiti

New Member
I have a \[code\]MessageBox\[/code\] display when submitting a stream read file. However the box keeps coming up even after clicking okay. When I hold down the Enter key to fly through the boxes, only one field gets added from the file.Heres my codebehind\[code\]if (FileTypeDDL.SelectedValue =http://stackoverflow.com/questions/3661812/="Calendar Dates" && fileName == "calendar_dates.txt"){ //Check if full txt has already been uploaded SEPTA_DS.CalendarDatesTBLDataTable GetCalendarDates = (SEPTA_DS.CalendarDatesTBLDataTable)cdta.GetDataByCategory(Convert.ToString(Session["Cat"])); var category = Convert.ToString(CategoryDDL.SelectedItem); var service_id = Convert.ToString(row["service_id"]); var date = Convert.ToString(row["date"]); var exception_type = Convert.ToString(row["exception_type"]); if (GetCalendarDates.Rows.Count < 1) { int insertData = http://stackoverflow.com/questions/3661812/Convert.ToInt32(cdta.InsertCalendarDates(category, service_id, date, exception_type)); } else { DialogResult result = MessageBox.Show("This will overwrite the current list. Are you sure you wish to continue?", "Important Message", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); if (result == DialogResult.Yes) { int updateData = http://stackoverflow.com/questions/3661812/Convert.ToInt32(cdta.UpdateCalendarDates(category, service_id, date, exception_type, Convert.ToInt32(GetCalendarDates.Rows[0]["CalendarID"]))); } else { Response.Redirect("~/Import.aspx"); } }}\[/code\]I just want the box to appear once and on 'Yes' insert the data. Why and how can I accomplish this.EDIT: I just realized that this code is within a \[code\]foreach\[/code\] loop and that's why it's reoccurring. My new question; How do I only show this \[code\]MessageBox\[/code\] once?
 
Back
Top