This is a migrated thread and some comments may be shown as answers.

Redirect When Null Exception Occurs

1 Answer 50 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 04 Mar 2012, 03:55 PM
hi

I have this
<telerik:ResourceType DataSourceID="sdsResourceItem" KeyField="Resource_ID" 
    Name="ResourceGroup" TextField="Resource_Name" ForeignKeyField="Resource_ID" />
</ResourceTypes>

How do i redirect to another page if no Resources are found or empty? Right now i am getting "System.NullReferenceException: Object reference not set to an instance of an object"

Thanks a lot.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 06 Mar 2012, 04:10 PM
Hi,

I wonder if handling DataBound of RadScheduler to check the resource count would help you with this case.

protected void RadScheduler1_DataBound(object sender, EventArgs e)
   {
       Response.Write((sender as RadScheduler).Resources.Count);
   }


All the best,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
L
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or