Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all,

page name :test.ascx
JavaScript
$.ajax({
            type: 'POST',
            url: 'test.ascx/GetRandomSalt',
            contentType: 'application/json; charset=utf-8',
            data: {},
            dataType: 'json',
            async: false,
            success: function (r) {
                result= r.d;
                document.getElementById('<%=hdnRandomKey.ClientID %>').value = result;
                callback(result);
            }, error: function (x, e) {
                alertify.alert("Server not responding, Please try again later.")
            }
        });


here i have used this test.ascx user control in three various aspx pages in another folder

in ADMIN folder
----------------
first.aspx
second.aspx
third.aspx

these three aspx pages having test.ascx

in USERCONTROL folder
----------------------
test.ascx

both ADMIN folder and USERCONTROL folder are in same path


problem is if i placed the webmethod in first.aspx.vb its working fine(it means i have to write the same code in three pages know). Instead of that i placed the webmethod in test.ascx.vb file means its not working.

Requirement is I need to write the webmethod in test.ascx it easy to handle three pages

Thanks in advance,
Vels
Posted
Updated 10-Mar-15 18:38pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900