Results 1 to 2 of 2

Thread: dhtml hidded div - javascript pagemethods

  1. #1
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question dhtml hidded div - javascript pagemethods

    I have a dhtml hidded div that contains a button that on-click runs a javascript function that passes form info to a server-side webmethod function(vb.net).

    Everything works fine with IE and Chrome, but when using Firefox the server-side webmethod is not executed.

    All the other code within the javascript seems to execute, but not the pagemethod.

    Simplified Client Side [CODE]:

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"/>

    <div id="divAddToPartsList" style="display:none;">
    <p style="text-align:right;padding:10px;"><asp:Button id="btnAddToPL" runat="server" Text="Add" width="100px"></asp:Button>
    </div>



    <script type="text/javascript">
    function AddMe(custpn, custnote, askpn) {
    var pn = document.getElementById(custpn);
    var note = document.getElementById(custnote);
    var ask = document.getElementById(askpn);

    // call server side method
    PageMethods.UpDateUserParts(pn.value, note.value, ask.checked);

    ModalPopUp.hide();

    location.reload(true);

    }
    </script>


    Very Simplified Server [CODE]:

    btnAddToPL.Attributes.Add("onclick", "javascript:AddMe('" & txtCustPN.ClientID & "', '" & txtCustNote.ClientID & "' , '" & cbNoCustPN.ClientID & "')")



    <WebMethod()> _
    Public Shared Function UpDateUserParts(ByVal custPN As String, ByVal custNote As String, ByVal askpn As String)

    '**lines removed to keep it short

    Return ""
    End Function


    Thanks,

    Pat

  2. #2
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Problem solved.

    Javascript needed some adjustments to work correctly with Firefox.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •