<button id="mybutton" accessKey="h" type="button"
runat="server"><u>B</u>utton</button>.
if visual studio hasn't already, add this
protected System.Web.UI.HtmlControls.HtmlButton mybutton; // c#
protected WithEvents mybutton as System.Web.UI.HtmlControls.HtmlButton
'vb
now just add the event as you did with the asp:button.
// for c#
private void InitializeComponent()
{
this.mybutton.ServerClick += new
System.EventHandler(this.mybutton_ServerClick);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void mybutton_ServerClick(object sender, System.EventArgs e)
{
}
' for vb.net
Private Sub mybutton_ServerClick(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles mybutton.ServerClick
End Sub
If you are having trouble with interference in the Page_Load, make sure
you are having things happen at the right time, maybe something like
this would help.
// c#
if(!Page.IsPostBack)
{
// run code to show data
}
// vb.net
if not Page.IsPostBack
'run code to show data
end if
HTH,
Darren Kopp
http://blog.secudocs.com/