Some new features built into asp.net 2 make more usable the data entry form without having to resort to additional scritp Js. Through the use of panel you can set different default button in different areas of a page.
Classic esempio, la form di imputazione dati per effettuare il log in e la textbox per effettuare una ricerca. Se sono sulla stessa pagina, quando si preme invio all'interno di un textbox verrà eseguito l'evento associato ad uno dei due bottone in input.
<html>
<body>
<form defaultbutton=“button1” runat=“server”>
<asp:button id=“button1” text=“bottone1” runat=“server”/>
\u0026lt;asp:panel defaultbutton="button2" runat="server">\u0026lt;asp:textbox id="cerca" runat="server"/>
\u0026lt;asp: button id = "Button2" runat = "server" />
\u0026lt;/ asp: Panel>
\u0026lt;/ form>
\u0026lt;/ body>
\u0026lt;/ html>
0 comments:
Post a Comment