I have the code below
RssFeedReader rss = (RssFeedReader)this.ParentToolPane.SelectedWebPart;
My problem is only at run time do I know if ‘this.ParentToolPane.SelectedWebPart’ is of type RssFeedReader or of type ‘RssCountry’
How would I check the object type and cast it appropriatley?
Many Thanks,
You can do this:
To check if it is of a certain type. Alternatively, you can use ‘as’ to use it as a type, and it will be null if it was not of that type.