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 ExtensionsModulesModulesAccessing Server Side Variables with Javascript Accessing Server Side Variables with Javascript
Previous
 
Next
New Post
1/22/2013 10:27 AM
 
Sorry I didn't mean I need to use the ID to run the web service, I need the id to run against other db's that we have the id in so I can pull other data that we populated based on the id....if that makes sense. I don't need it for authentication I need it for a where clause.

I need the setting to show debug information on the jquery side...just seems very hard to get a client variable value from a server side value when it is very easy in straight ASP.NET code.
 
New Post
1/22/2013 12:20 PM
 
If you use the authentication then you have the ID. No worries about did the user relogon as someone else? Did their login expire...

>>...seems very hard to get a client variable value from a server side value when it is very easy in straight ASP.NET code

DNN *is* ASP.Net code. Pretty much any technique that works in ASP.Net works in DNN. Some of them are less desirable in the DNN env. What favorite technique is not working for you?

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/23/2013 9:16 AM
 
I am not using the login id for any SQL authentication, I am using it to past to a WHERE clause through the web method. I am using SA credentials. I want to query the db (outside of a dnn db) with their id (which we have in other tables). Anyway I fixed getting the login to the client side but below I need help.

In the load event I am setting the debug value as so....
c# code....
string strDebug = "false";
if (Settings.Contains("Debug"))
strDebug = Settings["Debug"].ToString();

javascript code...
var debug = '<%=strDebug%>';
trace("debug - " + debug );

Trace is just a function I wrote that alerts if it's IE, captures to the console if it's Chrome....

I then get the following error....
Error: Sharp Sales Assistant is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: c:\inetpub\wwwroot\DNN\DesktopModules\DealershipSalesReporting\View.ascx(8): error CS0103: The name 'strDebug' does not exist in the current context ---> System.Web.HttpCompileException: c:\inetpub\wwwroot\DNN\DesktopModules\DealershipSalesReporting\View.ascx(8): error CS0103: The name 'strDebug' does not exist in the current context at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at DotNetNuke.UI.Modules.WebFormsModuleControlFactory.CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) at DotNetNuke.UI.Modules.ModuleControlFactory.LoadModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---

 
New Post
1/23/2013 11:13 AM
 
I think you miss my point. Suppose you have a webservice called from your page. Suppose you call a method...
string Method(int id)

... suppose my name is Joe Hacker. I see that your page calls Method(101) when I use your site. (Trivially easy becuase I use FireFox/Fiddler or any number of other free tools.

I may call Method(102) and see what data belongs to member 102 of your site. Soon I can drain away all the data exposed by that web service - maybe including stuff I should not see.

My point is DON'T DO IT LIKE THIS AS IT'S INSECURE. Use the Attribute I mentioned before. It has nothing to do with your SQL Server credentials. I will also point out that using the sa account is considered bad practise.

There is not enough context to help with your other problem.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/25/2013 4:32 AM
 
Hi

In code behind file, need to extend PortalModuleBase class, after that you can use UserID property to get current logged-in user id and store in a hidden field. Which you can access using jquery in client side.

Thanks
Sibabrata
Mindfire Solutions
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesAccessing Server Side Variables with Javascript Accessing Server Side Variables with Javascript


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