javascript and UpdatePanel Question

Last post 05-21-2008 2:41 PM by prujohn. 2 replies.

Sort Posts:

  • javascript and UpdatePanel Question

    05-18-2008, 10:49 AM
    • Member
      29 point Member
    • prujohn
    • Member since 04-06-2007, 12:55 PM
    • Texas
    • Posts 17

    I have a piece of javascript, which scrolls my multiline <asp:textbox> to the bottom line on each postback.  This works just fine.  However, when I wrap the textbox inside a <asp:updatepanel> for partial page postbacks, it no longer works.  I suspect this is because the javascript is no longer being called during the partial page postback, so my question is:  Where can I place the code so that it executes properly AFTER the partial page postback occurs?

     Thanks!

  • Re: javascript and UpdatePanel Question

    05-18-2008, 12:57 PM
    • Star
      8,079 point Star
    • Ken Tucker
    • Member since 12-23-2003, 1:40 PM
    • Port St. John, Florida
    • Posts 1,216
    • TrustedFriends-MVPs

    If the javascript is in another file you need to register it with the scriptmanager to be able to use the javascript functions

     

     <asp:ScriptManager ID="sm1" EnablePartialRendering="true" runat="server">
                    <Scripts>
                        <asp:ScriptReference Path="Silverlight.js" />
                        <asp:ScriptReference Path="CreateSilverlight.js" />
                    </Scripts>
                </asp:ScriptManager>

     

     

  • Re: javascript and UpdatePanel Question

    05-21-2008, 2:41 PM
    • Member
      29 point Member
    • prujohn
    • Member since 04-06-2007, 12:55 PM
    • Texas
    • Posts 17

    In this case, the javascript is just within <script> tags on the page.  The javascript works, it just doesn't work when the elements are within an UpdatePanel.

Page 1 of 1 (3 items)