Originally want to give a button to add a confirm, different scores hint different information (more than 80 qualified, less than 80 unqualified, prompted whether to submit), the first to use the button. Atribute.add (); But every time it gets to the value of the label control before the refresh, later on the Internet to see the use of viewstate[], but still no, no way, can only use JS:
<script>function myconfirm () { if (document.getElementById (' lbl '). value>=80) {return confirm (' Qualified, Do you want to submit? ')} else {return confirm (' unqualified, is it submitted? ')}}</script>
However, always error: undified; should be unable to find the ID of the control, no way, suddenly thought can be used in the browser F12, see the need to get the ID of the control, the original use of the master page after the resolution of the ID is the master page + control ID.
Finally put the code written today, later encountered can also see:
<asp:button id= "Btn_commit" runat= "Server" text= "Submit Results" class= "btn btn-primary pull-right" onclientclick= "return MyFunction () "onclick=" Btn_commit_click "/><script type=" Text/javascript ">functionmyFunction () {varHj=document.getelementbyid (' Ctl00_content_lbl_hj '). InnerText; if(hj>=80) { returnConfirm (' Your rating is ' eligible ' to confirm the submission? ')) ; }Else{ returnConfirm (' Your rating is ' unqualified ' to confirm the submission? ')) ; } } </script>
Asp. NET gets the control ID on the master page or content page