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 ExtensionsModulesModulesModule settings not renderingModule settings not rendering
Previous
 
Next
New Post
12/6/2010 5:12 PM
 
Okay, I have this working in countless other modules, but for some reason, the following code is not working.  I must have missed something obvious.  Can you help me out?

Very simple module.  Just has settings and a view control.  The settings control works fine.  It saves the settings and reloads them for editing them on the settings screen.  I can step through the settings control and see everything saved and loaded correctly.

In the C# codebehind of the view control, I can pull the settings successfully this way:

if (Settings.ContainsKey("ImageURL"))
                ImageURL.Text = Settings["ImageURL"].ToString();  // where ImageURL is a literal control

But if I try the following in the ascx, it returns a null string:

<a href="<%# Settings["ImageURL"].ToString() %>"></a>

That renders <a href=""></a>

What's going on?  Thanks a bunch.

AldenG
 
New Post
12/6/2010 11:31 PM
 
Here are a couple of possibilities:

1. Since you are using a databinding markup (<%#) are you calling DataBind on the control which contains your anchor tag? If not, you should be using assignment markup (<%=).

2. I would use single quote characters around the value for the href attribute to avoid a mis-match of begin/end quotes:

<a href='<%# Settings["ImageURL"].ToString() %>'>

My own preference would be to set the attribute in the code-behind to avoid the situation where the Settings hashtable does not contain a value for the "ImageURL" key and if so to substitute a default value.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule settings not renderingModule settings not rendering


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