you should add the click handler to the button directly using its Attributes collection: Button1.Attributes.Add("onclick",
"parent.frames['leftNav'].location.href='page2.aspx';") This adds an additional click handler to
the button that will run before the page gets submitted.