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 Popup To Show A CustomPage...Using Popup To Show A CustomPage...
Previous
 
Next
New Post
10/3/2011 2:19 PM
 
No one has any clues about this? I can't get the DNN popup to work as a Server Redirect OR a Hyperlink within the codebehind page.

However, if I hardcode the Hyperlink version of the code directly on the ASCX page as a simple [A HREF], it works.

I have to be missing something. Can anyone please help me? I am on a project deadline and I could really use some assistance here.

Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
New Post
10/3/2011 4:49 PM
 
Hi Ben,

There are several ways to do this, depending on the certain situation. Check-out my blog post on how to use the popups and let me know if it works for you.

http://www.dotnetnuke.com/Resources/B...


.::. Vince.
 
New Post
10/3/2011 6:14 PM
 
Thank you for responding. Unfortunately I already came across your BLOG and it didn't work for me.

When I use the Server Redirect method:
- If I use NavigateURL() to format the URL, it doesn't work at all. I get a blank page.
- If I use EditURL() to format the URL, I get a "Page Cannot Be Displayed" error. Apparently Response.Redirect() doesn't like Javascript...?
- If I use EditURL() to format the URL and parse out the Javascript portions...
...I see the page (plainly w/ no container) and not as a Popup, just a regular page.

When I use the Hyperlink method:
- If I use NavigateURL() to format the URL, it doesn't work at all. I get a blank page.
- If I use EditURL() to format the URL, the Popup appears for a split second, then closes.
- Note: Pre-pending "return " to UrlUtils.PopUpUrl() causes Javascript error, badly formatted code

Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
New Post
10/3/2011 7:35 PM
 
Hi Ben,

With your Hyperlink method, try the following implementation and see if it works for you:

[C#]
var MY_URL = Globals.NavigateURL(YOUR_tabID, YOUR_controlKeyName);
myHyperLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(MY_URL, this, PortalSettings, true, false));


::
 
New Post
10/3/2011 7:44 PM
Accepted Answer 
Ben,

This code will never properly open a popup for you.

strRedirectURL = EditUrl("ProviderOptions_List") 
Me.cmdTrainings.Attributes.Add("OnClick", strRedirectURL) 

You are missing key elements of the process - namely - you need to make sure the OnClick is properly formatted with the script code that is needed to make the magic happen - this part of the process is handled bu the PopUpUrl() method - And that is its ONLY job - it does not format the URL - its job is to take the target url and create a javascript call that allows the popup to function.  = And most significantly it appends "&popUp=true" to the end of the eventual URL.

The reason your popup is opening and then automatically closing again . . . is that the popUp=true query parameter is missing - the popup javascript code looks at the url of the page its displaying - if it does not find popup=true in the url it closes the popup.

Have a look at this code:

strRedirectURL = EditUrl("ProviderOptions_List") 

cmdTrainings.NavigateUrl = strRedirectURL;

popupHeight = 500;
popupWidth = 900;

if ((PortalSettings.EnablePopUps )
{
       cmdTrainings.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(cmdTrainings, this, PortalSettings, true, false, popupHeight, popupWidth));

}

Note as a side comment - if you want your POPUP to be able to redirect to another PAGE inside the popup - you need to make sure that the &popUp=true parameter is also passed around to the new page - otherwise the popup will close

Westa
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUsing Popup To Show A CustomPage...Using Popup To Show A CustomPage...


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