Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. SEARCH A FILE in solution explorer?

SEARCH A FILE in solution explorer?

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-nethelptutorial
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John Sundar
    wrote on last edited by
    #1

    hai, i m using ASP.NET with C# (.net 2005, 2.0 framework) here i create a directory named "A" and some files are in this folder (say... A1,A2). and outside of "A" folder there are some files (out1,out2). how can i specify the path to fetch the file from A1 to out1??? how to achieve it? help me - KARAN

    S 1 Reply Last reply
    0
    • J John Sundar

      hai, i m using ASP.NET with C# (.net 2005, 2.0 framework) here i create a directory named "A" and some files are in this folder (say... A1,A2). and outside of "A" folder there are some files (out1,out2). how can i specify the path to fetch the file from A1 to out1??? how to achieve it? help me - KARAN

      S Offline
      S Offline
      Sandeep Kumar
      wrote on last edited by
      #2

      hi.... you can achieve that by using namespaces. Give same namespace for all the pages that u want to access.

      Regards, Sandeep Kumar.V

      J 1 Reply Last reply
      0
      • S Sandeep Kumar

        hi.... you can achieve that by using namespaces. Give same namespace for all the pages that u want to access.

        Regards, Sandeep Kumar.V

        J Offline
        J Offline
        John Sundar
        wrote on last edited by
        #3

        kindly could u give me an example, so that i can understand clearly. And also can u specify by means of the example which i have posted?. thank you...

        S 1 Reply Last reply
        0
        • J John Sundar

          kindly could u give me an example, so that i can understand clearly. And also can u specify by means of the example which i have posted?. thank you...

          S Offline
          S Offline
          Sandeep Kumar
          wrote on last edited by
          #4

          Hi... for the file A1 which is in the folder suppose give namespace as namespace TestNamespace { public class A1 { ............ } } for the file which is out side the folder give same name space like... namespace TestNamespace { Public class out1 { } } now if you want ot access any for the files you can directly call that cllas name in your class file.... like.... namespace TestNamespace { Publc class out2 { out1 o=new out1(); A1 a=new A1(); } } Hope with this you can get some thing...... :)

          Regards, Sandeep Kumar.V

          J 1 Reply Last reply
          0
          • S Sandeep Kumar

            Hi... for the file A1 which is in the folder suppose give namespace as namespace TestNamespace { public class A1 { ............ } } for the file which is out side the folder give same name space like... namespace TestNamespace { Public class out1 { } } now if you want ot access any for the files you can directly call that cllas name in your class file.... like.... namespace TestNamespace { Publc class out2 { out1 o=new out1(); A1 a=new A1(); } } Hope with this you can get some thing...... :)

            Regards, Sandeep Kumar.V

            J Offline
            J Offline
            John Sundar
            wrote on last edited by
            #5

            wow...... S sandeep.. i got it.. this is i needed. :-D and another clarification sandeep? suppose my full path is : c:\inetpub\wwwroot\project\tet_pr.ascx another file path is : c:\inetpub\wwwroot\project\output\file1.ascx how to switch from one file to another by using the below statement? int a; if (a == 1) this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("te_pr.ascx")); else this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("file1.ascx")); help me . thanks for understanding......... - KARAN

            S 1 Reply Last reply
            0
            • J John Sundar

              wow...... S sandeep.. i got it.. this is i needed. :-D and another clarification sandeep? suppose my full path is : c:\inetpub\wwwroot\project\tet_pr.ascx another file path is : c:\inetpub\wwwroot\project\output\file1.ascx how to switch from one file to another by using the below statement? int a; if (a == 1) this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("te_pr.ascx")); else this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("file1.ascx")); help me . thanks for understanding......... - KARAN

              S Offline
              S Offline
              Sandeep Kumar
              wrote on last edited by
              #6

              John Sundar wrote:

              this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("file1.ascx"));

              i guess above code should be like below one...... this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("\output\file1.ascx"));

              Regards, Sandeep Kumar.V

              J 1 Reply Last reply
              0
              • S Sandeep Kumar

                John Sundar wrote:

                this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("file1.ascx"));

                i guess above code should be like below one...... this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("\output\file1.ascx"));

                Regards, Sandeep Kumar.V

                J Offline
                J Offline
                John Sundar
                wrote on last edited by
                #7

                Thanks sandeep.. to fetch the te_pr.ascx from file1.ascx??????????? how to achieve it?

                S 1 Reply Last reply
                0
                • J John Sundar

                  Thanks sandeep.. to fetch the te_pr.ascx from file1.ascx??????????? how to achieve it?

                  S Offline
                  S Offline
                  Sandeep Kumar
                  wrote on last edited by
                  #8

                  give same namespace for both user controls then same as classes you can access them.....

                  Regards, Sandeep Kumar.V

                  J 1 Reply Last reply
                  0
                  • S Sandeep Kumar

                    give same namespace for both user controls then same as classes you can access them.....

                    Regards, Sandeep Kumar.V

                    J Offline
                    J Offline
                    John Sundar
                    wrote on last edited by
                    #9

                    can u tel me with the example sandeep?? plz.. suppose my full path is : c:\inetpub\wwwroot\project\tet_pr.ascx another file path is : c:\inetpub\wwwroot\project\output\file1.ascx how to switch from "file1" to "tet_pr" while i m working in "file1.ascx" int a; if (a == 1) this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("te_pr.ascx")); else this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("file1.ascx")); help me . thanks for understanding......... - KARAN

                    C 1 Reply Last reply
                    0
                    • J John Sundar

                      can u tel me with the example sandeep?? plz.. suppose my full path is : c:\inetpub\wwwroot\project\tet_pr.ascx another file path is : c:\inetpub\wwwroot\project\output\file1.ascx how to switch from "file1" to "tet_pr" while i m working in "file1.ascx" int a; if (a == 1) this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("te_pr.ascx")); else this.MenuPlaceHolder.Controls.Add((UserControl)LoadControl("file1.ascx")); help me . thanks for understanding......... - KARAN

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #10

                      This seems incredibly nasty, but I'd say if you need to do this, your best bet is to set what path leads to a particular control, in your resources, and swap resource files as needed. As someone else said, odds are you need to name the classes the same if you want to be able to use them when you swap them out like this. OR a better idea again is to simply define an interface that the controls you're using will have in common and access them via that interface.

                      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups