Answered How to read cs file of aspx in addin

  • Wednesday, April 11, 2012 7:19 AM
     
     

    Hi,

    I am trying to read cs file of aspx that opened in visual studio. I catch aspx file but I could'nt catch to cs file (abc.aspx --> abc.cs)

    I can read all files of project with project ProjectItems and child without cs files of aspx files.

    I need to read properties and methods of this cs file.

    Thanks,

    Mehmet

All Replies

  • Wednesday, April 11, 2012 10:44 AM
     
     Answered Has Code

    Hi,

    I solved

    ProjectItems items = fileItem.ProjectItems;
    csFileName = aspxfile + ".cs";
    foreach (ProjectItem item in items)
      {
       if ((item.Properties.Item("Extension").Value.ToString() == ".cs") && (item.Name == csFileName) && (item.FileCodeModel != null))
         {
          // just do...
       }
    }

    Mehmet.

    • Marked As Answer by MehmetK Wednesday, April 11, 2012 10:44 AM
    •  
  • Monday, April 16, 2012 2:28 AM
    Moderator
     
     

    Hi Mehmet,

    Glad to know you have already resolve this issue.

    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us