Hi Dirk,
I take it you're looking to set a default button. You can do that with
Page.RegisterHiddenField _
("__EVENTTARGET", "Button1")
You need to provide the name of the button (Button1) in this example. Sample
code below.
Does this help?
Ken
Microsoft MVP [ASP.NET]
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Page.RegisterHiddenField _
("__EVENTTARGET", "Button1")
End Sub
Private Sub Button2_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button2.Click
Label1.Text = "You clicked Cancel"
End Sub
Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Label1.Text = "You clicked OK"
Label2.Text = TextBox1.Text
End Sub
<form id="Form1" method="post" runat="server">
<P>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></P>
<P>
<asp:Button id="Button2" runat="server"
Text="Cancel"></asp:Button>
<asp:Button id="Button1" runat="server" Text="OK"></asp:Button></P>
<P>
<asp:Label id="Label1" runat="server"></asp:Label></P>
<P>
<asp:Label id="Label2" runat="server"></asp:Label></P>
</form>