I have the following code in the front end
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
<script type="text/javascript">
//on upload button click temporarily disables ajax to perform upload actions
function conditionalPostback(sender, args)
{
if (args.EventTarget == '<%= ((Button)frmvwMainDetail.FindControl("bttnRateUploadUpload")).UniqueID %>') {
args.EnableAjax = false;
}
}
</script>
...
</asp:content>
When the page load, it’ complaining about ((Button)frmvwMainDetail.FindControl(“bttnRateUploadUpload”)).UniqueID is null value. So my question how to put some checking on this ?
use ClientID not UniqueID
The control’s UniqueID property is rendered as the name attribute.
The control’s ClientID property is rendered as the id attribute.
Do something with your code
OnPageLoad: