Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModuleshow to use jquery ajax in dnn module how to use jquery ajax in dnn module
Previous
 
Next
New Post
2/24/2012 3:28 AM
 

Thanks for your help. I got the jquery autocomplete to work :-) The missing pieces I found at http://encosia.com/3-mistakes-to-avoi... 

After setting the contenttype on the request and packing the data in the correct way my webservice started returning json instead of XML.


 
New Post
2/29/2012 9:32 PM
 
you can try get url for MyPage.ascx:

string current_page = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "this is controlKey - null if View.ascx","mid"+ModuleId.ToString())

and in $.ajax url: <%= current_page%>


 
New Post
4/2/2012 8:24 AM
 
MrTung wrote:
you can try get url for MyPage.ascx:

string current_page = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "this is controlKey - null if View.ascx","mid"+ModuleId.ToString())

and in $.ajax url: <%= current_page%>


 hi Tung i followed ur way like =

in page load code behind method i get the current url this way and assign to a control -

string current_page = Globals.NavigateURL(PortalSettings.ActiveTab.TabID,"", "mid" + ModuleId.ToString());
subCommentButton.Text = current_page;

also added method to call in code behind -

[WebMethod]
        public static string GetDate(int jewellerId, string locale)
        {
            //System.Threading.Thread.Sleep(2000);
            return jewellerId.ToString() + locale;

        }

then in view.ascx page i call the AjaxTest function on button click below -

function AjaxTest() {  

var test= $("#<%= subCommentButton.ClientID %>").val(); //getting the url
est);
        $.ajax({
            type: "POST",
            url: test+"/GetDate",
            data: '{ "jewellerId":"' + 123 + '", "locale":"c#" }',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                // Replace the div's content with the page method's return.
                $("#show").text(msg.d);
                msg.d);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                extStatus);
            }
        });
}

But i get error alert !!! plz help what's wrong??

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModuleshow to use jquery ajax in dnn module how to use jquery ajax in dnn module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out