make sure "Button" is the name of your button that you are adding the attribute to.
Example:
<asp:Button id="btnSubmit" .... runat="server" />
btnSubmit.attributes.Add("onClick","javascript:alert('data saved successfully')");
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
check to see if it is actually being added. You can do this by viewing the source of your document.
Search for your "id" and see if the onclick attribute is correctly put on the submit button.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68