Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,

I'm getting the following error when i put AdRotator inside a table cell:

"Error rendering control - Table1
An unhandled exception has occured.
Object reference not set to an instance of an object."

I've tried moving AdRotator out of the table and the error dissapers. When i put it back i reapers again. All other controls when put in table cell dont cause this error. Its most probably something on my side (not Visual studio's), but i'm having a really hard time pinpointing error in code. The code goes as follows

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="About.aspx.cs" Inherits="About" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   <asp:Table ID="Table1" runat="server" Height="28px" Width="35px"><asp:TableRow runat="server" ID="TableRow1"><asp:TableCell runat="server" ID="TableCell1">
       <asp:AdRotator ID="AdRotator1" runat="server" Visible="true"/>
   </asp:TableCell></asp:TableRow></asp:Table>
    </div>
    </form>
</body>
</html>



Any ideas? (note: .cs file is empty aka has only auto generated code inside)

edit: I forgot to mention that when i build solution everything is as it should be and AdRotator works great even when i refresh the page. This error appears only in Design View.
Posted
Updated 24-Mar-11 4:46am
v3

1 solution

I've tried moving AdRotator out of the table and the error dissapers. When i put it back i reapers again.
I am not sure of it but it might be because of XML not defined for the AdRotator. Did you try to set the AdvertisementFile property to some XML? Can try once.
 
Share this answer
 
Comments
metalclaw 24-Mar-11 7:25am    
Thank you for replaying,
I did try setting AdvertisementFile value, it didnt change anything, I'm still getting the error.

I forgot to mention that when i build solution everything is as it should be and AdRotator works great even when i refresh the page. This error appears only in Design View.
Sandeep Mewara 24-Mar-11 8:06am    
Oh! That change the whole thing. Hmmm... Ok.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900