Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'add this attribute once (and not on every page load) - place the code in the Not Page.IsPostBack block If Not Me.Page.IsPostBack Then '--add java confirmation to command button Me.cmdEmailLDL.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to send an email to the Customer with a Live Date Letter attachment?');") '--add a client-side OnClick event to the EmailLDL button Me.cmdEmailLDL.Attributes.Add("onclick", "cmdEmailLDL_Click(this);") End If End SubThank you,