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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...URLControl Issue in DNN Platform 9.1.1URLControl Issue in DNN Platform 9.1.1
Previous
 
Next
New Post
7/20/2017 8:30 PM
 

When trying to use the UrlControl in a custom module I keep getting the error below.  This happens when I set the Url property of the control

Message:Error rendering URLControl subcontrols. 
StackTrace
InnerMessage:Object reference not set to an instance of an object.
InnerStackTrace: at DotNetNuke.UI.UserControls.UrlControl.DoChangeURL() at DotNetNuke.UI.UserControls.UrlControl.OnPreRender(EventArgs e)

 

 ASCX File:

 

<portal:URL ID="dnnUrlCntr" runat="server" Required="false" UrlType="T" ShowDatabase="false" ShowImages="false" ShowUpLoad="false" ShowUsers="false" EnableViewState="true" ShowNewWindow="false" ShowTrack="false" ShowLog="false" ShowNone="true" ShowFiles="false" ShowUrls="false" />

Code Behind:

 

protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!Page.IsPostBack)
{
var locCtl = new CountyController();

ddlCounty.DataSource = locCtl.GetCounties().OrderBy(c => c.CountyName);
ddlCounty.DataTextField = "CountyName";
ddlCounty.DataValueField = "CountyId";
ddlCounty.DataBind();
ddlCounty.Items.Insert(0, new System.Web.UI.WebControls.ListItem("< Select County >", ""));

var tc = new ProgramController();

if (ProgramId > 0)
{
var t = tc.GetProgram(ProgramId);
if (t != null)
{
txtProgramName.Text = t.ProgramName;
dnnUrlCntr.Url = t.Url;
}

var plp = tc.GetProgramCountyPhoneListItems(ProgramId);
rptLocatonList.DataSource = plp;
rptLocatonList.DataBind();
}
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}

 

 

 
New Post
7/21/2017 12:46 PM
 

Same results when using DNNUrlControl

Message:Error rendering URLControl subcontrols.
StackTrace:
InnerMessage:Object reference not set to an instance of an object.
InnerStackTrace:
at DotNetNuke.Web.UI.WebControls.DnnUrlControl.DoChangeURL() at DotNetNuke.Web.UI.WebControls.DnnUrlControl.OnPreRender(EventArgs e)

 
New Post
7/21/2017 3:16 PM
 
It appears that the issue is related to a querystring parameter. Apparently the parameter name "pid" causes the control to flake out. Changed the parameter name and now everything works as expected. Weird ...
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...URLControl Issue in DNN Platform 9.1.1URLControl Issue in DNN Platform 9.1.1


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