Tried using $('#btnEnter').prop('disabled', true);
but my button will not be disabled. Also when I click the back button the page will crash.
jquery
<script>
function gray() {
$('#btnEnter').prop('disabled', true);
}
</script>
Child page that has button to be disabled
<asp:Button ID="btnEnter" CssClass="btn btn-light btn-md btn-block" runat="server" Text="Enter Value" OnClick="btnEnter_Click"/>
codebehind child page
public partial class Institution1Submit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
checkConnection();
}
//check if connected before going submit page
public async void checkConnection()
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "n", "gray();", true);
}}
Back button
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("../Nodes.aspx");
}