I am trying to use update panel in visual webpart(farm solution only) but when i click on button nothing happens


     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                   <section id="sec1" class="myclass1">
        <div class="mytit">
            <h2 >Header</h2>

        <div id="mydiv" runat="server" >

         <div class="row">
            <div class="col-xs-12 ">
                <a class="btn " href="#" role="button" id="btnLoadData"  runat="server" OnServerClick="btnLoadData_Click" >Show rows</a>



on click event

 protected void btnLoadData_Click(object sender, EventArgs e)


When i click on button nothing happens and no error in console. If i remove update panel and click on button then it loads data. What is issue here?

  • Do you have anything else on your page apart from this webpart?
    – Asad Refai
    Commented Aug 14, 2015 at 9:27
  • @AsadRefai i have lot of other html controls which i have put in code above
    – Happy
    Commented Aug 14, 2015 at 9:29
  • Yes thats correct, I meant do you have any other SharePoint's OOB webparts like CSWP etc. Also have you registered the ajax assembly in your control and placed script manager ?
    – Asad Refai
    Commented Aug 14, 2015 at 9:31
  • @AsadRefai what do you mean script manager and where to put it?
    – Happy
    Commented Aug 14, 2015 at 9:33
  • @AsadRefai i now tried to add scriptmanager in my myusercontrol.ascx like <asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" /> But got error that u should have only script manager on page
    – Happy
    Commented Aug 14, 2015 at 9:39

1 Answer 1


May be your href="#" is creating your problem. Try to replace it with href="javascript:void(0);".

Best approach would be to use asp.net controls like asp:button or asp.LinkButton instead of pure html a, here you will not be required to place some extra efforts.

  • i have found reason why its not working but dont know how to fix. Its cAUSING because of my master page. While activating feature i set my master page as default. I tried to deactivate feature and then check the page. Update panel works. So its something in master page which is blocking
    – Happy
    Commented Aug 17, 2015 at 12:09
  • Happy, I am facing the same problem as you with the masterpage. Have you found a solution ?
    – esbeone
    Commented Feb 10, 2016 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.