URL Control Issues

Last post 09-06-2005 9:12 AM by AerosSaga. 3 replies.

Sort Posts:

  • URL Control Issues

    04-05-2005, 4:18 PM
    • Participant
      991 point Participant
    • jjmartin
    • Member since 02-25-2004, 2:37 PM
    • Phoenix, AZ
    • Posts 203

    I am having an issue with the URLControl User control - I would classify this as a bug.

    I am trying to dynamically add the URL control to a page in code behind.

    DotNetNuke.UI.UserControls.UrlControl urlBox = (DotNetNuke.UI.UserControls.UrlControl)this.LoadControl("~/controls/UrlControl.ascx");
    urlBox.FileFilter =DotNetNuke.Common.Globals.glbImageFileTypes;
    urlBox.Width="300";
    urlBox.ShowTabs=
    false
    ;
    urlBox.ShowUrls=
    false
    ;
    urlBox.UrlType = "F";
    urlBox.ShowTrack =
    false
    ;
    urlBox.ShowLog =
    false
    ;
    urlBox.Required =
    true
    ;
    returnControl = urlBox;

    I then add the control to the page.  This is in response to a postback.  Since all the processing of the ShowTabs, ShowUrls, etc is done in the OnLoad event

    If Not Page.IsPostBack Then

    This obviously causes issues with how the control is displayed.
    It doesn't seem like I will be able to use this control for my purposes with this build of DNN.   If anyone has other suggestions I'd be glad to hear them.

    I have also found problems with the TextEditor control which I have documented in another topic: http://forums.asp.net/873498/ShowPost.aspx

    Jeff Martin
    MCSD C# .NET
    http://www.jeffmartin.com
  • Re: URL Control Issues

    04-05-2005, 5:50 PM
    • Participant
      991 point Participant
    • jjmartin
    • Member since 02-25-2004, 2:37 PM
    • Phoenix, AZ
    • Posts 203

    I solved this by copying the URLControl into another vbproject , renamed it URLControl2 (so I wouldn't alter core code)  and altered it so that the

    If Not Page.IsPostBack Then

    to only surround the stuff it really needs to surround (and im not sure if it even needs this)

    If Not Page.IsPostBack Then
    ' save persistent values
    ViewState("ModuleId") = Convert.ToString(_ModuleID)
    ViewState("SkinControlWidth") = _Width
    End If

    The control seems to be working fine.  This seems like a safe update to make into core to get the functionality of being able to add this control to a page on a postback.

     

    Jeff Martin
    MCSD C# .NET
    http://www.jeffmartin.com
  • Re: URL Control Issues

    09-06-2005, 9:12 AM
    • Contributor
      2,985 point Contributor
    • AerosSaga
    • Member since 04-03-2004, 12:21 PM
    • Williamsport, PA
    • Posts 597
    I just fiddled with this for hours over the weekend, in a module settings page with a post back, I am somewhat relieved that I happened to find this post this morning I was beginning to think I was going crazy.
  • Re: URL Control Issues

    09-06-2005, 9:38 AM
    • Contributor
      6,015 point Contributor
    • leupold
    • Member since 06-01-2004, 9:17 AM
    • Karlsruhe / Germany
    • Posts 1,197
Page 1 of 1 (4 items)