Passing web controls to an external method

A

Andy B.

I have the following method stub:

public function DeleteNewsArticle(ByVal NewsID as Guid, ByVal Title as
string, ByVal Description as string, ByVal Body as string, ByVal Archived as
boolean, ByRef NewsList as object) as integer
end function

The NewsList as object is the entire list of news articles. Chances are is
that it will be a gridView. How do I check to see what type of control it is
and convert it back to its original control type?
 
N

Nathan Sokalski

Use the GetType and CType methods. However, I would suggest making your
signature a little more specific than Object. Even if you are not going to
make it ByRef NewsList as GridView, you could at least make it ByRef
NewsList as Control or ByRef NewsList as WebControl. Hopefully this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top