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.0Control IDs Vary Between Edit and View ModesControl IDs Vary Between Edit and View Modes
Previous
 
Next
New Post
6/22/2009 2:34 PM
 

I've been developing a custom module, and everything had been working according to plan. However, I had always been logged in as host. As soon as I logged out, my Submit button no longer worked. In fact, it appeared that none of my events would fire when I was logged out. Upon further testing, I found out that the same behavior took place if I was logged in as host, and in View mode. If I switch back to Edit mode, everything works.

Looking a little deeper, I found that DNN is appending extra identifiers to my control IDs in view mode. Investigating the page source, my submit button's ID in Edit mode looks like the following:

dnn$ctr425$ViewMyModule$myButton  But in view mode, it looks like this:
dnn$ctr425$ViewMyModule$ViewMyModule$myButton

I went to View Mode, switched on Firebug in Firefox, and changed the ID to the "edit mode version". My submit button worked.

Why would DNN add extra terms to my control's ID in view mode? Am I looking at the source of the problem, or is it something else?
 
New Post
6/22/2009 8:54 PM
 

It looks like it may have something to do with control container naming. Maybe there's an extra container inserted into the site when it goes into View Mode. Even so, I'm able to reference my control from the code behind page in Edit Mode by saying something like "myButton.Text", not "dnn$ctr425$ViewMyModule$myButton". Why should I have to worry about it in View Mode?

 
New Post
6/22/2009 9:20 PM
 

OK, problem solved! In the Page Settings section of the module's settings, I set Cache Time to 0. Why does that fix it? I'm not sure. I would appreciate any enlightenment.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Control IDs Vary Between Edit and View ModesControl IDs Vary Between Edit and View Modes


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