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...Getting StartedGetting StartedUserController.GetCurrentUserInfo() not working with Asp.net applicationUserController.GetCurrentUserInfo() not working with Asp.net application
Previous
 
Next
New Post
3/1/2014 11:51 PM
 

Dear Friends, I need urgent help Pls

I will explain my problem i little more detail


I have a DNN site "http://newversion.kginfotech.com" .After logs in to this site I have a Link module for redirecting to two another modules .

1.Link1
2.Link2


When user wil click Link1 A new window will come ie. http://newversion.kginfotech.com/F1/ASPProject (It is an ASP.net application)
When user wil click Link2 A new window will come ie. http://newversion.kginfotech.com/F2/SilverlightProject (It is a silverLight application)


Now my requirement is Both project page load needs current username of DNN site(http://newversion.kginfotech.com)
For that I created a webservice in DNN site with the code below

<%@ WebService Language="VB" Class="WebServiceDNNUser" %>

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports DotNetNuke.Entities.Users

http://www.newversion.kginfotech.com/")> _
_
Public Class WebServiceDNNUser
Inherits System.Web.Services.WebService

#Region "GetUsername()"
_
Public Function GetUsername() As String
Dim strUsername As String = ""
' Get the current user
Dim objUserInfo As UserInfo = UserController.GetCurrentUserInfo()
strUsername = objUserInfo.UserID
' If the user is not -1 they are logged in
If objUserInfo.UserID > -1 Then
strUsername = objUserInfo.Username
End If
Return strUsername
End Function


#End Region


End Class


I called this webservice from my both project correctly and I am getting logged username from DNN site in my silverlight application ie.Link2 page.
The problem is From Link1 page( http://newversion.kginfotech.com/F1/ASPProject) When I try to get the current username of DNN .It is always returns the objUserInfo.UserID as "-1"


This is the issue I am facing.

How can I solve this?

 
New Post
3/5/2014 3:09 AM
 
Without seeing what you have setup

-- the asp.net application is likely finding its own appcontext which among other things would mean that the call to the webservice would no longer have any sort of clue what the logged on user was or is.

The silverlight app on the other hand is likely being instantiated entirely in the client browser and does not touch the existing appcontext on the server - and as such would likely continue to function correctly.

FWIW - I would strongly recommend against trying to run ANY sort of asp.net application inside the context or domain at the same time as DNN - its simply not a supported methodology - and from what ive been seeing lately in terms of httpmodule and httphandler issues could lead to a whole boat load of other wierd issues on your site.

Having said all that - why dont you simply pass the current user name thru to the applications as a parameter.

Westa
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedUserController.GetCurrentUserInfo() not working with Asp.net applicationUserController.GetCurrentUserInfo() not working with Asp.net application


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