I've this problem for 3 days and I couldn't find the real answer. I want that if I click a button the code will run and not to refresh all the page. For example:
ASPX code
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="New" OnClick="ASPxButton1_Click"></dx:ASPxButton>
<dx:ASPxButton ID="ASPxButton2" runat="server" Text="Delete"></dx:ASPxButton>
CS code
protected void ASPxButton1_Click(object sender, EventArgs e) //new button
{
ASPxButton2.Enabled = false;
}
That's basicly what I want to do. Click the new button and make the delete button enabled false without refreshing all the page.
What I tried:
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="New" OnClick="ASPxButton1_Click" onclientClick=" return false;"></dx:ASPxButton>
<asp:button ID="Button1" runat="server" Text="New" OnClick="Button1_Click" onclientClick=" return false;"></asp:button>
<asp:button ID="Button1" runat="server" Text="New" OnClick="Button1_Click"></asp:button>
<asp:button ID="Button1" runat="server" Text="New" OnClientClick="DisableButton(); return false; "></asp:button>
function DisableButton() {
document.getElementById("<%= ASPxButton2.ClientID %>").click();
}
Tried UpdatePanel too but I use MasterPage and that's why it doesn't work.
Aucun commentaire:
Enregistrer un commentaire