How to preform updatepanel postback from javascript

Need to do a partial page post back from javascript, I have it now  but the whole page post back. When I set it to UpdateMode="Conditional" everything else on the page post back not the section I need.
 
<div class="box-3">
                                                                 Service<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" > 
<ContentTemplate> 
<asp:DropDownList ID="cmbNewService" runat="server" DataTextField="Serv_Type" DataValueField="pk_CarrierID">
</asp:DropDownList>
<asp:LinkButton ID="LinkButton1" runat="server" style="display:none;" onclick="textboxchange" > 
LinkButton </asp:LinkButton>
</ContentTemplate> 
</asp:UpdatePanel> 
</div>

Open in new window

below is the java being called

  function raiseAsyncPostback() {
      __doPostBack("<%= me.LinkButton1.UniqueID %>", "");
  }

Open in new window

crundleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

santhimurthydCommented:
Change the code as follows and try

function raiseAsyncPostback() {
    document.getElementById("<%=  LinkButton1.UniqueID%>").click();
 }

0
crundleAuthor Commented:
No effect, nothing was posted back. HTML code below from rendering.


 function raiseAsyncPostback() {
      document.getElementById("ctl00$MainContent$LinkButton1").click();
   // __doPostBack("ctl00$MainContent$LinkButton1", "");
 }
 <div id="MainContent_UpdatePanel1">
      
                                                                        <select name="ctl00$MainContent$cmbNewService" id="MainContent_cmbNewService">
            <option value="1::1">Port\Port</option>
            <option value="1::2">Port\Door</option>
 
      </select>
<a id="MainContent_LinkButton1" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$LinkButton1&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))" style="display:none;">
                                                                            LinkButton
                                                                        </a>
0
santhimurthydCommented:
Are your using the VS2010 and asp.Net 4.0 for the development,

then add the below attribute ClientIDMode="Inherit" to the control and check


<asp:LinkButton ID="LinkButton1" runat="server" style="display:none;" onclick="textboxchange" ClientIDMode="Inherit"
LinkButton </asp:LinkButton>
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

santhimurthydCommented:
Hi

Please use the below property as the HyperLink is not gettting in teh way as other control

ClientIDMode="AutoID"

<asp:LinkButton ID="LinkButton1" runat="server" style="display:none;" onclick="textboxchange" ClientIDMode="AutoID" >
LinkButton </asp:LinkButton>

Tested the smae it's workign fine

 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
crundleAuthor Commented:
tried both and didn't fire. I'll setup a demo page to see if something else is causing the problem.
0
santhimurthydCommented:
I have identified the issue in the control declaration

style="visibility:hidden;"

<asp:LinkButton ID="LinkButton1" runat="server" style="visibility:hidden;" onclick="textboxchange" ClientIDMode="AutoID" > 
LinkButton </asp:LinkButton>

change the option display to visibility.
Check this for the clarification as why the event is not get fired for "dispaly:none"
http://webdesign.about.com/od/css/f/blfaqhidden.htm

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.