protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "javascript:window.open ('http://www.microsoft.com/'); return false;");
}
where Button1 is an 'asp:button'.
Also, note the 'return false;' part of the script: this makes sure that the page is not posted back to itself.

No comments:
Post a Comment