|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to trigger action from button embedded in another control?I have a button ("button1") embedded into another control ("LoginView1"). In the code-behind environment of VWD (visual web dev.), i cant' use the event button1_onclick because 'button1' doesn't appear in the list of the events. How can i then trigger an action when clicking the button? Thanks again Cliff aspx: ---- <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table> <asp:LoginView ID="LoginView1" runat="server"> <LoggedInTemplate> <fieldset style="height: 425px; width: 335px;"> <tr><td> <tr><td><asp:Button ID="Button1" runat="server" Text="Click here /></td></tr> </td></tr> </fieldset> </LoggedInTemplate> </asp:LoginView> </table> </asp:Content> You could just add an event handler to it at aspx
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> then in code Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) End Sub Show quoteHide quote "Terry" <n*@mail.pr> wrote in message news:O26VAzNUHHA.1364@TK2MSFTNGP06.phx.gbl... > Hi, > > > I have a button ("button1") embedded into another control ("LoginView1"). > In the code-behind environment of VWD (visual web > > dev.), i cant' use the event button1_onclick because 'button1' doesn't > appear in the list of the events. > How can i then trigger an action when clicking the button? > > Thanks again > Cliff > > aspx: > ---- > <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" > Runat="Server"> > <table> > <asp:LoginView ID="LoginView1" runat="server"> > <LoggedInTemplate> > <fieldset style="height: 425px; width: 335px;"> > <tr><td> > <tr><td><asp:Button ID="Button1" runat="server" Text="Click here > /></td></tr> > </td></tr> > </fieldset> > </LoggedInTemplate> > </asp:LoginView> > </table> > </asp:Content> > > > Two ways:
1. switch to designer, hover around loginview, you shall see a small black arrow, click to expand the LoginView Tasks, select 'views' from combo box, and you'll see you temaplte with button, double click on the button - designer will generate handler code. 2. in template declaration: <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> and code beside/behind (make sure autoeventwireuop is switched on') Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) End Sub -- Show quoteHide quoteMilosz "Terry" wrote: > Hi, > > > I have a button ("button1") embedded into another control ("LoginView1"). In > the code-behind environment of VWD (visual web > > dev.), i cant' use the event button1_onclick because 'button1' doesn't > appear in the list of the events. > How can i then trigger an action when clicking the button? > > Thanks again > Cliff > > aspx: > ---- > <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" > Runat="Server"> > <table> > <asp:LoginView ID="LoginView1" runat="server"> > <LoggedInTemplate> > <fieldset style="height: 425px; width: 335px;"> > <tr><td> > <tr><td><asp:Button ID="Button1" runat="server" Text="Click here > /></td></tr> > </td></tr> > </fieldset> > </LoggedInTemplate> > </asp:LoginView> > </table> > </asp:Content> > > > > Thanks both ...
Show quoteHide quote "Milosz Skalecki [MCAD]" <mily242@DONTLIKESPAMwp.pl> schreef in bericht news:193F2506-B82C-4E61-97BB-8FF413DF73F6@microsoft.com... > Two ways: > 1. switch to designer, hover around loginview, you shall see a small black > arrow, click to expand the LoginView Tasks, > select 'views' from combo box, and you'll see you temaplte with button, > double click on the button - designer will generate handler code. > 2. in template declaration: > <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" > Text="Button" /> > and code beside/behind (make sure autoeventwireuop is switched on') > > Protected Sub Button1_Click(ByVal sender As Object, ByVal e As > System.EventArgs) > > End Sub > -- > Milosz > > > "Terry" wrote: > >> Hi, >> >> >> I have a button ("button1") embedded into another control ("LoginView1"). >> In >> the code-behind environment of VWD (visual web >> >> dev.), i cant' use the event button1_onclick because 'button1' doesn't >> appear in the list of the events. >> How can i then trigger an action when clicking the button? >> >> Thanks again >> Cliff >> >> aspx: >> ---- >> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" >> Runat="Server"> >> <table> >> <asp:LoginView ID="LoginView1" runat="server"> >> <LoggedInTemplate> >> <fieldset style="height: 425px; width: 335px;"> >> <tr><td> >> <tr><td><asp:Button ID="Button1" runat="server" Text="Click here >> /></td></tr> >> </td></tr> >> </fieldset> >> </LoggedInTemplate> >> </asp:LoginView> >> </table> >> </asp:Content> >> >> >> >>
AJAX and embeded controls
menu navigation control and CSS interference how to change email defined when creating account? ControlToValidate Script manager equivalent... How can I do? GridView Header Height why is this html table still visible? Put the date of today in a text control problem with FindControl How can I select a row by clicking on ANY column |
|||||||||||||||||||||||