In a vb.net 2010 web form application, I want to display a message to the user when a student has more than one record in the database for the current school year. The database problem is caused by a user not entering the data correctly using vendor
software. The user can fix the problem by using the vendor software. The database problem is only allowed to be updated by the user by using the vendor software.
My goal is to generate the message to be displayed in the same format in the two locations where this message needs to be displayed.**Note: I can not change the locations of where the error messages need to be generated without needing to do a major rewrite of the application.
I would prefer for the javacript code to be able to place the message in _master.ErrorMessage.However my second choice would be for the vb.net 2010 web form code to be able to generate the javacript alert message.
The following 2 places is the code that I know works right now:
1. The following is vb.net 2010 web form code using the error message in the Mater Pages: If (gvAttendanceLetters.DataKeys(0).Values(3) = "999") Then _master.Visible = True _master.ErrorMessage = "You have entered more the one record for the current school year for the student you selected " End If
2. The following is javacript code that is placed at the start of the default.aspx page: function GetStudentLetterTemplate(scyear, scnum, milestone, studentnum) { if (milestone == '999') { alert('You have entered more the one record for the current school year for the student you selected '); } });
}
Thus would you me tell me what option would work along with the code that will solve the problem? If the code needs to stay the way, I listed above just let me know.