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 ExtensionsModulesModulesUsing dnnConfirm on control hidden by server-side codeUsing dnnConfirm on control hidden by server-side code
Previous
 
Next
New Post
3/23/2013 2:38 PM
 
I'm trying to use dnnConfirm on a linkbutton in a panel that is initially hidden.  The panel is set to visible in the ascx file and is hidden in the code behind when the control is loaded. Depending on the user's actions, the linkbutton may be displayed in the code behind.  If it is displayed and clicked, dnnConfirm should be invoked.  The code works fine if the linkbutton is never hidden by server-side code.  However, once the linkbutton is hidden and then re-displayed, dnnConfirm no longer works.  What am I missing?
Thanks.
 
New Post
3/24/2013 4:27 AM
 

All jquery actions work by binding themselves to elements in the current visible page domain.  

When an element is 'hidden' by server side code it moves out of scope
 - or in other words the elements in question may no longer be visible to the client page domain.

So even though the code to bind dnnalert may be on your page - and appear to fire - it is not actually
binding when the panel is hidden.

In this case - you would need to look at where you are doing the binding code - that javascript side code.  
And make sure that it rebinds correctly each time the page is refreshed.

Westa

 
New Post
3/24/2013 11:16 AM
 

Thanks Wes.  I pretty much knew that was the situation, but was hoping for a magic bullet to make it work.  The jquery code was already outside of any panels being hidden was wrapped in document.ready.

The solution was to replace the $(document).ready(function() { with Sys.Application.add_load(function() { which runs on all postbacks and rebinds the controls once they're visible.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUsing dnnConfirm on control hidden by server-side codeUsing dnnConfirm on control hidden by server-side code


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