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...DNN Platform (o...DNN Platform (o...Object Reference exception when trying to use Response.redirectObject Reference exception when trying to use Response.redirect
Previous
 
Next
New Post
6/29/2009 8:42 PM
 

Hi, i have been strugglng for a couple of hours with the following problem. I have a image link button that is trying to do response.redirect but as soon as it executes i get an exeption in the DNN skinning engine. My code is not related to the skinning engine at all.

Here is my code...

        Protected Sub ImgViewCart1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImgViewCart1.Click
            Dim URL As String = NavigateURL(_ViewCartPageID)
            Response.Redirect(URL)
        End Sub

if have confirmed that the NavigateURL(_ViewCartPageID) function return the following: "/DNN/Home/tabid/38/ctl/74/Default.aspx"

Here is the exception that i receive:

Object reference not set to an instance of an object.

  at DotNetNuke.UI.Skins.Skin.ProcessSlaveModule()
   at DotNetNuke.UI.Skins.Skin.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.AddedControl(Control control, Int32 index)
   at System.Web.UI.ControlCollection.Add(Control child)
   at DotNetNuke.Framework.DefaultPage.Page_Init(Object sender, EventArgs e) in C:\inetpub\wwwroot\DNN\Default.aspx.vb:line 492
   at System.Web.UI.Control.OnInit(EventArgs e)
   at System.Web.UI.Page.OnInit(EventArgs e)
   at DotNetNuke.Framework.PageBase.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any idea? please help.

 
New Post
6/30/2009 2:25 AM
 

 I've had a lot of 'skin' errors similar to what you have due to UI issues in my modules. So it may be related to the UI in a module on the page you are trying to link to. 

Do you have any custom modules on that page? Done any modifications to the ascx of the modules on that page?

What happens if you go to "/DNN/Home/tabid/38/ctl/74/Default.aspx" with out clicking the link, just entering it in the address bar? (with the proper beginning webaddress)

 
New Post
6/30/2009 4:42 AM
 

Hi Baatezu

I have custom a module on the source and destination pages both written by me. If i enter the URL manually i get no error at all. I also do not get the error if i access the page via the menu.

 

 i have debugged the exception and it happens on the call to request.redirect. The debugger breaks on the Default page of DNN in the Page_Init on the following line "SkinPlaceHolder.Controls.Add(ctlSkin)"

Can you maybe give me some idea of what i can be doing to cause this? I am really stumped.

Thanks

Wayne

 

 

 
New Post
6/30/2009 4:59 AM
 

I found the solution!!!

I even posted the error on the forum and did not notice it. The URL is incorrect.

NavigateURL has diffirent ways you can call it. The one way takes a tabid (int) and the other a controlkey (string). My varaible  _ViewCartPageID is a string and was thus being handled as a controlkey while i wanted and expected it to be handled as a int. Its a simple cast error.

 


 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Object Reference exception when trying to use Response.redirectObject Reference exception when trying to use Response.redirect


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