c# - Show content with button click without postback -


<asp:updatepanel id="uptaskinfo" runat="server" clientidmode="static" updatemode="conditional">     <contenttemplate>         <div class="customalertdisplay hidetag" id="customalertdisplay" runat="server">             <section class="notif notif-warn">                 <h6 class="notif-title">warning!</h6>                 <p>this task forced checked out user. changes not saved site.master.</p>                 <div class="notif-controls">                     <a href="javascript:void(0);" class="notif-close" id="cbtn" title="close message">close</a>                 </div>             </section>         </div>     </contenttemplate>     <triggers>         <asp:asyncpostbacktrigger controlid="lb1" />     </triggers> </asp:updatepanel> <asp:updatepanel id="up1" runat="server" clientidmode="static" updatemode="conditional">     <contenttemplate>         <asp:linkbutton id="lb1" onclick="lbsave1_click" runat="server">show</asp:linkbutton>     </contenttemplate> </asp:updatepanel> 

css:

.hidetag {     display: none; } 

code-behind:

public void lbsave1_click(object sender, eventargs e) {     customalertdisplay.attributes.remove("hidetag");     uptaskinfo.update(); } 

i trying show customalertdisplay div when click lb1 linkbutton without doing postback not working.

how can update code, when button clicked div shown without postback.

you can't use c# events without postback, they're fired @ server. use jquery add/remove/toggle css class instead.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -