This SHOULD be simple - I want to be able to see the logged in user in an article. Some of my articles have embedded iFrames and it would be just as good to be able to know the current user there too. I know the CSContext.currentuser.user has information - but how exactly do I reference that object from the article? There is a little script in there already - can I just add it there?
Very new to CS and javascript so be as verbose as possible with replies!!
Thanks!!!
You can only use CSContext.Current.User.Username to get the current user in the codebehind of the asp.net page, not via javascript.
CS Documentation | Nintendo Wiikly
ok - so what other alternatives do I have. If I create an ASPX page that is embedded in an article iFrame will CS maintain the information as it passes to the embedded page? If not, can I just create my own aspx page and have it be accessed from CS directly (without the article iFrame)?
Thanks!
Also - I see in the article there is script that references the Document that loads it - could I stick the username in a tag of an attribute and grab it from there? I just need the username - I can get everything else I want from there.
The current user should be maintained in as long as the user's logged in to your website, however you will need to ensure your custom ASPX page inherits CSThemePage for CSContext to work.
Where in the article do you see script that references the document, and what script is it you see.
<SCRIPT type=text/javascript>for (var i = 0; i < document.getElementById("CommonContentInner").getElementsByTagName("div").length; i++) if (document.getElementById("CommonContentInner").getElementsByTagName("div").className == "CommonContentArea") document.getElementById("CommonContentInner").getElementsByTagName("div").id = "HomeContentArea"; </SCRIPT>
It is on every article on this site I am wrestling with.
Where in the article do you see this. Can you provide a link?
http://www.iasca.com/content/join/02ase.aspx
Since you aren't an admin, you can't see this - but this is the code behind the link:
<UL><LI>For only fifteen bucks, you’ll get a LIFETIME membership as an IASCA ASE member! <LI>If that’s not enough, how about we give you a ONE YEAR SUBSCRIPTION to PERFORMANCE AUTO & SOUND magazine! <LI>AND, a FREE DTS audio A/B comparison CD! <LI>PLUS, access to our members only forum on the IASCA website, giving you the opportunity to speak with IASCA Members all around the world AND your own page on our website to show off your ride! </LI></UL>
<P mce_keep="true"> </P>
<P align=center mce_keep="true"><B><A class="" href="http://store.iasca.com/index.php?app=ccp0&ns=prodshow&ref=IA_MEM_ASE" target=_blank mce_href="http://store.iasca.com/index.php?app=ccp0&ns=prodshow&ref=IA_MEM_ASE"><FONT size=6>Click here to Join as an ASE Member!</FONT></A></B></P>
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com