SEARCH A FILE in solution explorer?
-
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
-
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
hi.... you can achieve that by using namespaces. Give same namespace for all the pages that u want to access.
Regards, Sandeep Kumar.V
-
hi.... you can achieve that by using namespaces. Give same namespace for all the pages that u want to access.
Regards, Sandeep Kumar.V
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...
-
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...
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
-
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
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
-
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
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
-
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
Thanks sandeep.. to fetch the te_pr.ascx from file1.ascx??????????? how to achieve it?
-
Thanks sandeep.. to fetch the te_pr.ascx from file1.ascx??????????? how to achieve it?
give same namespace for both user controls then same as classes you can access them.....
Regards, Sandeep Kumar.V
-
give same namespace for both user controls then same as classes you can access them.....
Regards, Sandeep Kumar.V
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
-
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
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 )