Prior to upgrading to .NET 4.5 the code was working correctly with findControl, but it was because they were being added with the prepended placeholder location. We are now receiving
Object reference not set to the instance of an object.
on code that looks like this;
Dim toDate As String = NullConvert.ToString(CType(Page.FindControl("ctl00$ContentPlaceHolder1$Transactions1$txtToDate"), TextBox).Text)
this was working perfectly in the past, but is no longer working. I have tried eliminating the pre-pended contentplaceholder reference to just;
Dim toDate As String = NullConvert.ToString(CType(Page.FindControl("txtToDate"), TextBox).Text)
but that receives the same error. I believe the issue is because the codebehind is in an included HeaderControl Master page, not in the page that is actually calling the _click event of the button. Do I need to reference the child page to find this or is there a better solution? I am not the most advanced .NET programmer if you can't tell. Thank you