开发者

jQuery ajax in DotNetNuke preserving user authentication

开发者 https://www.devze.com 2022-12-28 02:50 出处:网络
I want to use jQuery\'s ajax functionality in a DotNetNuke module I\'m developing. I want the ajax call to be authenticated via DNN\'s membership functionality.

I want to use jQuery's ajax functionality in a DotNetNuke module I'm developing.

I want the ajax call to be authenticated via DNN's membership functionality.

I want the ajax开发者_如何学运维 response as json.

How can I do this?

I've looked at IWeb and IWebCF -- it's not clear to me from much Googleing and scanning the forums whether these modules would allow me to create a web service that would accept a simple post request and return json (seems like they want to do it the ASP.NET AJAX way with a generated proxy, I'd prefer to just use jQuery's AJAX call functionality).

Seems you can't create a simple webmethod in a DNN module (since they are developed as User Controls (.ascx)).

I could deploy an .asmx file with module, but that won't leverage DNN's authentication system.

Ideas?

I'm currently developing against DNN 4.9.5


We just did this, but we ended up having to copy a bunch of code from the MembershipModule class to set the current user from their cookies (since that module exits out when the path doesn't end with a known file extensions).

If you're able to get a web service working via IWeb/IWebCF, you should be able to call that without the proxy (though it might still automatically generate the proxy), the same way that you would call any other ASP.NET Web Service.


Brian, that's exactly what we're looking for as well.

The iWeb system seems more suited to .Net development patterns and not jQuery/JavaScript heavy development styles.

Would you be willing to share the generic parts of your code? Maybe even on CodePlex?


I was actually able to solve this problem with the help of the iweblite project on Codeplex I am using it together with an asmx webservice on the server side and jQuery/Ajax on the client side. I am creating a series of posts at my blog to show how it works. It will still be a week or two before I have time to explain that part of it. I had to make some modifications to the iweblite project for it to work so I sent a message to the project owner asking if I could fork it or take over but I never got a response.

0

精彩评论

暂无评论...
验证码 换一张
取 消