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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How do I...How do I...
Previous
 
Next
New Post
3/14/2008 5:17 AM
 

Hi all,

I need to insert

<%= UserController.GetCurrentUserInfo().Username %>

in a module's ascx file. However, simply inserting it doesn't seem to work. Is there a way to make this available or is an alternative token available? I just need to obtan the username of the current user.

Thanks

Duc

 

 
New Post
3/14/2008 2:50 PM
 

I just did it in mine without any issues.

Are you receiving any errors?          Is there any particular reason why you would place this code inline with your presentaiton layer?

 

It would make more sense to use a Label and populate it with code-behind when an event takes place... ie page_load etc.

 
New Post
3/15/2008 1:09 AM
 

Ah, I think my problem is that I try to insert it into a textbox control. I need to insert this token for a dymanically-generated URL. Is there an easy way to do this?

Thanks for replying,

Duc

 
New Post
3/16/2008 12:17 AM
 

duchoangle wrote

Ah, I think my problem is that I try to insert it into a textbox control. I need to insert this token for a dymanically-generated URL. Is there an easy way to do this?

Thanks for replying,

Duc


There shouldn't be much of a problem inserting the data into a TextBox.      What would the URL consist of?    Under what conditions is it generated?     It really sounds to me like you should be doing this in the code-behind for the form.

Here's an example...   The TextBox is placed in your form:

<asp:TextBox ID="mytextbox"></asp:TextBox>

And suppose you generate this url when a user clicks a button

Inside the button's event handler, you'd have code like this..

Dim url As String

url = ???  something that you need it to be...

mytextbox.text = url & UserController.GetCurrentUserInfo.Username

... or whatever.

I'm kinda shooting in the dark here, but that's what I would be working on.  If you ever have to change the way your code behaves, it will be much easier to edit if it's not spread all over the form with <% tags.

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How do I...How do I...


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