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/20/2012 10:37 AM
 

i want to use jquery ajax in my module's ascx page.i can do well in any asp.net app but cant do in dnn as dnn dont allow to work with aspx file.so may be there is something need to add properly in the url property of  jQuery.ajax({ });

Please guide me about using jquery ajax whether by a aspx or asmx page....with examples

 
New Post
2/20/2012 4:46 PM
 
as a test i used this in page -
$.ajax({
type: "POST",
url: location.href,
data: '{ "jewellerId":"' + 123 + '", "locale":"c#" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
msg);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
extStatus);
}

});

and in code behind -

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


}

but i get parse error! Please help
 
New Post
2/20/2012 5:08 PM
 
sorry the above reply will be ----
as a test i added a WebForm1.aspx page and used in view.ascx page -
$.ajax({
type: "POST",
url: "http://dnnver1/desktopmodules/module2/WebForm1.aspx/GetDate",
data: '{ "jewellerId":"' + 123 + '", "locale":"c#" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
msg);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
extStatus);
}

});

and in WebForm1.aspx.cs code behind -

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


}

but i get error alert Please help
 
New Post
2/23/2012 5:31 AM
 

Did you ever find a solution?

I'm trying to build an autocomplete textbox using jquery and is having almost the same problem as you.

When using contentType: "application/json charset=utf-8" I immediatly get an internalserver error indicatng that I cant communicate with the webservice I'm using. However, the webservice is responding with the correct data(as far as I can tell).

I suspect that jquery requries a jsonp reply instead of json, but I have no idea about how to create a webservice returning a jsonp format!?

 

 
New Post
2/23/2012 8:13 AM
 

no jsonp required...follow this post and baatezu's reply - http://www.dotnetnuke.com/Resources/Forums/forumid/111/threadid/342418/scope/posts/threadpage/1.aspx

this works but have some limitation. i wanted a better way using normal asp.net ajax but did not find yet....

 
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