asp.net - how to change label with button in vb? -
so want have button changes text of label when click , says page not available, when comment out update panel atleast shows up.
<form id="form1" runat="server"> <asp:scriptmanager id="s1" runat = "server"></asp:scriptmanager> <div> <h1>update panel test page</h1> start text : hello <br /> updated text: world<br /> <hr /> <asp:updatepanel id="p1" runat="server"> <contenttemplate> <asp:button id="button1" runat="server" text="update" onclick="updatelabel" height="29px" width="110px"/> --> text: <asp:label id="label1" runat="server" text="hello"></asp:label> </contenttemplate> </asp:updatepanel> </div> </form>
codebehind
public class aaaa inherits system.web.ui.page protected sub page_load(byval sender object, byval e system.eventargs) handles me.load end sub function updatelabel() string label1.text = "world" end function end class
you can remove onclick button , try classic method of handling events. code be... ( sorry i'm posting via app might not in code view )
protected sub changelabel(byval sender object, byval e system.eventargs) handles button1.click label1.text = "textgoeshere" end sub
Comments
Post a Comment