none
Get the title of aspx page in code using reflection? RRS feed

  • Question

  • Hi, I was wondering, I want to get the titles of all the pages in my assemblies using reflection. I already know I can get the files in the assembly, but is there any better way to do this than a search for the string Title=" inside of the page? It seems to me that searching for the string Title=" may not be the best way to do this. If anyone knows of a better way, please let me know. If you are convinced that a search for the string is the only way to do it, also let me know if that ts the case. Thanks
    • Moved by Bob Shen Wednesday, May 8, 2013 7:25 AM
    Friday, May 3, 2013 5:32 PM

All replies

  • You can always use Page.Title...

    Maybe I didn't understud this question right, it seems to obvious


    if (helpful) then Vote();

    Friday, May 3, 2013 5:36 PM
  • Marko, that is a helpful answer but does not solve my problem. I guess it is obvious, unless you have never used Page.Title before. Maybe I should explain what I need to do more in depth. I need to get the fields (tags inside of web pages that have ID and runat tag, I think)( inside of every page in the entire project. It is already using reflection to get all of the pages in the assembly (basically the project), but not as the type Page, but as the type Type. Then in this ojbect of type Type, it gets all the fields. So since it's not a "Page" object, I don't think I will be able to use Page.Title. I basically need to get the Title of all the pages in the project along with all the fields in every page. I am new to reflection and do not understand it in depth, so sorry if I'm missing something here about not being able to get Title from a Type object, but it seems to me that that's not possible and if I want to get Title I will have to get the pages.. Or is this what ReflectedType does (I just saw that with intellisense)
    • Edited by jamesiw Friday, May 3, 2013 6:26 PM
    Friday, May 3, 2013 6:24 PM