开发者

How to invoke server side function before invoking client side function

开发者 https://www.devze.com 2023-01-19 14:12 出处:网络
I am using an update panel in my application. Inside the update panel i am trying to trigger a html button, which in turn should invoke a server side function after which i need to invoke a client sid

I am using an update panel in my application. Inside the update panel i am trying to trigger a html button, which in turn should invoke a server side function after which i need to invoke a client side function.But the client side function is getting invoked first where as the server side function is not getting invoked at all.

Here is my code

<asp:UpdatePanel ID="embedcodepanel" runat="server" UpdateMode="Conditional">
   <Triggers>
         <asp:Async开发者_如何学GoPostBackTrigger ControlID="btnembedurl" EventName="onclick"/>
    </Triggers>
<ContentTemplate>
     <label id="lbl_embedcode" class="hide">Site Embed Code:</label>
     <textarea id="embedCode" class="embedCode hide">                                 CreateEmbedURL('<%=_redirectUrl%>')
      </textarea> 
 </ContentTemplate>
 </asp:UpdatePanel>

This is the Button code:

   <input id="btnembedurl" runat="server" type="button" value="Generate URL" onclick='ChannelEmbedURL();' />


onclick='ChannelEmbedURL();'

This is your problem. onClick of an input is client side.

0

精彩评论

暂无评论...
验证码 换一张
取 消