Products

Solutions

Resources

Partners

Community

About

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.0Another URLControl QuestionAnother URLControl Question
Previous
 
Next
New Post
10/9/2007 12:12 PM
 

I am trying to load a URLControl based on data from a database.  I have most of it figured out.  However, when I try to set the 'Open Link In New Window' checkbox as being checked using the below code, no error occurs, but the checkbox never gets checked.  Any help would be appreciated.

                                CheckBox chkNewWindow = (CheckBox)UrlControl.FindControl("chkNewWindow");
                                chkNewWindow.Checked = true;

 
New Post
10/10/2007 12:38 PM
 

It may actually be changing it back to false after you set it.  I was having problems with the URL control trying to set links in it, etc, if I loaded things in Page_Load or afterwards.  In theory you might be able to set the check during OnInit and get around that problem.  If you can (and maybe already tried it), try to debug it and step line by line and see what is happening to it when you run your code.

Personally, I was so fed up with the URL control I made my own.  It isn't perfect (but neither is the URL control), but you are welcome to download it and take a look at it.  One of these days I plan on rewriting it from scratch (I wrote it to mimic the current URL control, so that's the problem, hehe).  Anyway, it is available here (no registration necessary): http://foober.homeip.net/Development/DotNetNukeModules/tabid/213/language/en-US/Default.aspx


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
1/11/2011 9:40 PM
 
Brian Lovett wrote:

I am trying to load a URLControl based on data from a database.  I have most of it figured out.  However, when I try to set the 'Open Link In New Window' checkbox as being checked using the below code, no error occurs, but the checkbox never gets checked.  Any help would be appreciated.

                                CheckBox chkNewWindow = (CheckBox)UrlControl.FindControl("chkNewWindow");
                                chkNewWindow.Checked = true;

 
I know this is an old thread but I just ran into the same issue and came up with this simple solution that works.

DotNetNuke.UI.UserControls.UrlControl dnnUrl = (DotNetNuke.UI.UserControls.UrlControl)edit.FindControl("ctlURL");
dnnUrl.ShowNewWindow = true;
dnnUrl.ShowLog = false;
dnnUrl.ShowTrack = false;

dnnUrl.PreRender += new EventHandler(dnnUrl_PreRender);

        void dnnUrl_PreRender(object sender, EventArgs e)
        {
            DotNetNuke.UI.UserControls.UrlControl dnnUrl = (DotNetNuke.UI.UserControls.UrlControl)sender;
            CheckBox chkNewWindow = (CheckBox)dnnUrl.FindControl("chkNewWindow");
            chkNewWindow.Checked = true;
        }


 
New Post
9/7/2012 6:19 AM
 
I am trying to working with Gridview and URLControl, but when I select the "file location:" the URLControl not work. Please help me
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Another URLControl QuestionAnother URLControl Question


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