Click here to Skip to main content
16,004,944 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Web Services Pin
Piyush Vardhan Singh5-Jul-07 23:38
Piyush Vardhan Singh5-Jul-07 23:38 
AnswerRe: Web Services Pin
Sathesh Sakthivel5-Jul-07 23:44
Sathesh Sakthivel5-Jul-07 23:44 
GeneralRe: Web Services Pin
Sonia Gupta5-Jul-07 23:49
Sonia Gupta5-Jul-07 23:49 
GeneralRe: Web Services Pin
Sathesh Sakthivel5-Jul-07 23:51
Sathesh Sakthivel5-Jul-07 23:51 
QuestionForm check Pin
bluesperrow5-Jul-07 22:05
bluesperrow5-Jul-07 22:05 
AnswerRe: Form check Pin
N a v a n e e t h5-Jul-07 22:23
N a v a n e e t h5-Jul-07 22:23 
AnswerRe: Form check Pin
Fred_Smith5-Jul-07 22:27
Fred_Smith5-Jul-07 22:27 
QuestionEnumerate web user controls in a page? Pin
philiphgray5-Jul-07 21:45
philiphgray5-Jul-07 21:45 
I'm building a simple content management system in asp.net and I've put together a web user control (called "contentpanel") to display a panel of content in the page.

What i want to be able to do is enumerate the number of these controls that appear in a given page so that my content management application can interrogate a given page in a site and know how many blocks of content it needs to present for editing.

So, what i've been trying to do is put together a webservice that will sit in my web application, take a parameter of the web page name, work out what class the page relates to, and then return the number of "contentpanel" controls in that page.

I've got most of the way with this using the following code:
<br />
    Public Function PanelsInPage(ByVal PageName As String) As integer<br />
<br />
        'Set up a variable to hold the number of contentpanels<br />
        Dim PanelCount As Integer = 0<br />
<br />
        'Get a reference to the assembly for the site<br />
        Dim ThisAssembly As Assembly = System.Reflection.Assembly.GetExecutingAssembly<br />
<br />
        'Loop through all classes looking for the PageName supplied<br />
        Dim tClass As Type<br />
        For Each tClass In ThisAssembly.GetTypes<br />
<br />
            If tClass.BaseType.Name = "Page" And PageName = tClass.Name & ".aspx" Then<br />
<br />
<br />
            End If<br />
<br />
        Next<br />
<br />
        Return PanelCount <br />
<br />
    End Function<br />
<br />

The bit I'm struggling with is the middle of the If statement. I can identify the class, but I can't seem to find a way to enumerate the number of contentpanels that it contains. I've been using system.reflection, but I can't seem to pin down the right approach.

Is this even possible? Can a web user control be reflected from its containing page in this way? if so, can someone come up with some sample code for me (vb.net would be appreciated!)?
QuestionRe: Enumerate web user controls in a page? Pin
philiphgray9-Jul-07 5:31
philiphgray9-Jul-07 5:31 
QuestionGo to Page Number of PDF using iTextSharp Pin
swapnilbhavsar5-Jul-07 21:44
swapnilbhavsar5-Jul-07 21:44 
QuestionOutlook like calendar Pin
J Liang5-Jul-07 21:41
J Liang5-Jul-07 21:41 
QuestionWeb Service authentication Pin
sinale5-Jul-07 21:19
sinale5-Jul-07 21:19 
QuestionRegular expressions not validating pattern in JavaScript Pin
N a v a n e e t h5-Jul-07 20:45
N a v a n e e t h5-Jul-07 20:45 
Questiondata adpter Pin
$h@ma!|@5-Jul-07 20:40
$h@ma!|@5-Jul-07 20:40 
AnswerRe: data adpter Pin
Sonia Gupta5-Jul-07 20:45
Sonia Gupta5-Jul-07 20:45 
GeneralRe: data adpter Pin
$h@ma!|@5-Jul-07 20:59
$h@ma!|@5-Jul-07 20:59 
GeneralRe: data adpter Pin
Sonia Gupta5-Jul-07 21:05
Sonia Gupta5-Jul-07 21:05 
GeneralRe: data adpter Pin
$h@ma!|@5-Jul-07 21:09
$h@ma!|@5-Jul-07 21:09 
GeneralRe: data adpter Pin
Sonia Gupta5-Jul-07 21:18
Sonia Gupta5-Jul-07 21:18 
GeneralRe: data adpter Pin
N a v a n e e t h5-Jul-07 21:33
N a v a n e e t h5-Jul-07 21:33 
GeneralRe: data adpter Pin
mohantfor.net5-Jul-07 21:10
mohantfor.net5-Jul-07 21:10 
AnswerRe: data adpter Pin
N a v a n e e t h5-Jul-07 21:32
N a v a n e e t h5-Jul-07 21:32 
GeneralRe: data adpter Pin
$h@ma!|@5-Jul-07 22:45
$h@ma!|@5-Jul-07 22:45 
QuestionStill i didnt get proper answer, help plz.........., Pin
Member 38798815-Jul-07 20:36
Member 38798815-Jul-07 20:36 
AnswerRe: Still i didnt get proper answer, help plz.........., Pin
Venkatesh Mookkan5-Jul-07 20:42
Venkatesh Mookkan5-Jul-07 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.