I'm a novice programmer and I have been tasked with creating a pop-up for a page. It works...but it displays every time I continue away from the page when it needs to be set to display only if the date entered is prior to todays date. I tried manipulating it in the code behind but i'm not having any luck, can anyone help?
Here's the ascx for the popup. Please excuse the strange naming conventions: I'm working with a program that was created by a group of other people who created a bunch of custom controls.
<cmn:CmnPopupConfirmation ID="EffDateBackdatedPopupConfirmation" runat="server"
title="Enrollment Effective Date is Backdated"
titlecontentid="23176DAD-A884-41D0-B9A5-C3D7EBA699DA"
messagecontentid="2CFC32B8-26E8-4247-8F22-312A544FE568"
targetcontrolid="ContinueCmnButton"
popupextenderenabled="true"
message="You have chosen an effective date in the past. This request is not guaranteed and will need to be approved by the provider enrollment team. You will need to provide a copy of a claim proving services were rendered by the provider on the date you are requesting. In addition, make sure all required documentation cover the effective date you are requesting."
ConfirmationType="OKCancel"
/>The contentid fields are referencing a database with the content to display on the title bar of the popup and the content of the popup. I have hard-coded both the title and the message along with using these references because all other fields have been programmed that way and I honestly dont know why.
And here's my simple check in the C# code behind:
if (EnrollmentEffectiveCmnDate.Date < System.DateTime.Today)
{
EffDateBackdatedPopupConfirmation.Show();
}
else
{
EffDateBackdatedPopupConfirmation.PopupExtenderEnabled = false;
}
I have the modal set up to check when a user hits the continue button on the page, but when i set PopupExtenderEnabled = true, the popup will run every time i click Continue regardless of what i put in the code. It runs before the code is even touched. I stepped through and the if statment here is being set off and the lines are being hit, but nothing happens...I'm out of ideas as to why this isnt working. It LOOKS like the javascript is running the popup before it touches the code, but i dont even know where to begin with that.