Use The Same Asp Code In Different Websites And Different Folders?
Mar 10, 2011
I got one remote website and two local websites. All the .asp files are the same in 3 websites. In the remote website, there is a file aaa.asp, its url is
http://www.xxx.com/aaa.asp
In the first local website, the url of the same file is
http://127.0.0.1/local1/aaa.asp
In the second local website, the url of the same file is
http://127.0.0.1/local2/aaa.asp
My question is: In any .asp files (may be in different folders) of any above website, how can I get the url of aaa.asp by use the same code?
I want code in VB.NET to create javascript arrays of the folder contents that can then be used on the client end. I only need arrays for all folders contained in folders starting with ad_ and an array for all the base folders . like so:
var folders=["ad_folder","ad_code","ad_prep","ad_bin"]; var ad_folder=["folderA","folderB","folderC","anotherFolder","etcfolder"]; var ad_code=["folderA","folderB"]; var ad_prep=["folderA","etcfolder"]; var ad_bin=["etcfolder"];
note that I do not know the number of or the names of the folders, they can be different in different cases, I only have the root path.
In a website, I see some developers put code into app_code, and sometimes appcode (due to some bug), other files into DataModel, and other files into miscellaneous folders.
Is there a standard approach to organizing code within an application?
How is it different between an ASP.NET, MVC, Silverlight, Console, Database, and WCF application? The reason I mention WCF is because many people seem to have a shared types library that is linked between the server and client code.
Where can I learn these common practices without having to try, fail, and try again. I'd rather just learn it once from the experts.
I recently came aware of some knowledge I was not aware of before. One of my friends said that publishing a website with the code behind is a security risk. Instead, he insisted I only publish with the DLL's to prevent hackers from altering your code. Is this true? What are the advantages and disadvantages for doing this?
I was wondering about the best MVC practices for handling multiple websites from one MVC codebase. The functitonallity will pretty much be the same on all five sites, with most differences coming from styling/branding. Is it possible to dynamically set a Masterpage in MVC ? Should this even be attempted? Can everything get handled cleverly with routing?
I have mulitple websites using the same code but different web.config files. Is there a way where I can achieve not having multiple copies of the same code? so its easy to mantain?
the account we use to copy/publish websites to our web server is not allowing us access to push websites. I've added this account to the permissions in the links listed in the below link, but i don't have success when trying to push remotely. When the account is in the local admins account, everything works flawlessly, but we are not allowed to have it in there. http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/31be047e-4716-4974-b8a1-be0111b50199 I've googled and searched a lot for this particular error, but am not finding an answer that helps. We get this error, 'Unable to create the Web 'http://edea01/test/planning'. You are not authorized to perform the current operation', and the above link is the scenario that matches mine the most. I don't do develompment work, but am asked to figure out this connection problem.
I am just getting started with MVC so pardon the bonehead question, as I am sure that it is one: I understand the conceptual MVC pattern and the basics of routing in the .Net MVC implementation. My first little (VS 2010, Framework 4) project works great, until I get to this: In the project there is a physical folder structure like this :
Each of the folders contains an Index.aspx file (View). I want to link from "~/Views/Recipies/Index.aspx" View to the other Views with something like this:
[Code]....
where I have created an Outdoor controller to handle the Index View. The runtime unfortunately insists on looking for the Index view in "~/Views/Outdoor" rather than in "~/Views/Recipies/Outdoor". I have no doubt that I am falling victim to my years of coding .Net Forms, am missing a link in the chain of conventions relies upon, or some other painfully obvious thing, but I am nonethless stuck.
I was nosing around with Sysinternals Procmon today, just to see where some disk activity was coming from. In the process (pardon the pun) I noticed that Visual Studio was constantly testing for the presence of a bunch of web folders which didn't exist. Procmon log: "D:wwwroot" is my web root. The folder "csharp" doesn't exist.
This happens continually, every few seconds. When I create "csharp" and those subfolders, VS stops checking for them. But they don't exist in my project file and there's no need for them as far as I know. I don't know what they are for. Does anyone know why VS wants those folders? Their absence doesn't seem to affect anything, yet VS keeps checking if they exist, which is weird.
Not quite sure what you would call these but I am looking to create sub folders for my users eg
mysite.com/billyblue
What I have done up to this point is make a 404 page that handles unknown pages. It takes the part after the / and looks it up in the database. Then I redirect them to the relevant page.
I am having a few issues with this and to be honest am not to keen on handling it this way.
Does anyone have an alternative method for achieving this.
I recently upgraded to Windows 7 64 on my development machine. I am trying to setup my development environment. I have discovered something strange. When trying to set breakpoints in my ASP.Net application the breakpoints will only work if they are in the root folder. My ASP.Net project has various sub folders and any breakpoints in code that is stored in the sub folders turns yellow when debugging starts and states breakpoints will be missed.
I have deleted the temporary folder in c:windowsmicrosoft.netframework .... etc. etc. etc. I have checked the folder permissions in the root and all sub folders (they are the same). I have deleted and rebuilt the subfolders. I have right clicked VS2008 and said to run as administrator. Nothing seems to fix it. I can debug root level code behind pages but anything stored in a subfolder will not debug.
I am working on a project where I am using Tree View to display feeds that are available at the start up of the web application. I am also providing the user the opportunity to add new Rss Feeds and categorize them into different folders. When the user clicks on the particular web feed that they want, I need to display it using xmldatasource. When defining the XML Datasource tag and specifically the DataFile property, how can I dynamically pull over the URL based on what the user has selected from the TreeView?
I'm working on an ASP.NET webapp using the MVP pattern, and as I'm organizing my files I'm wondering - are there conventions on folders within projects and how they relate to namespaces?
I have a bunch of controls and a bunch of pages, and I was going to throw them into Controls and Pages folders with subfolders, but I didn't know if it was bad form to do this if I wasn't also going to seperate them out into namespaces.
I have an ASP.NET website with two different sections, root website and an /Admin sub-folder. I want to have two different forms authentication/login pages for them. /Admin folder should use/redirect /Admin/Login.aspx and root pages should use /Login.aspx. What should I do in web.config to accomplish this?
I have a CruiseControl.Net project set up to build an ASP.Net project, using an <svn> task to pull the latest code from source control.
On a successful build, I use a <buildpublisher> to copy the site to a deployment folder. My problem is that the buildpublisher is copying everything to the destination folder, including every .svn folder and its contents. What is the easiest way to strip out the .svn folders before copying to the deployment folder?
I want to add folders to keep things organized in App_LocalResources. Because when adding a lot of resorce files for different languages in this folder, files are getting messy. I added folders like
FYI : Actually what I did is working. I mean the way I mentioned above is the correct way. The reason why it wasn't working is something else so you can define your folders and the resource files above.
I have created a Folder and inside this folder, I have put a default.aspx and a default.cs file. I wonder how it is possible to find out what is the folders name as the default.cs is located in. This meens that I am looking for a code to determine what folder that is above in the hierarchy of folders?I cant use this code as this goes all the way back to the root:
I just got a windows vps setup at a hosting company and about to install a big web application that is a store front. Do I need to set any of the folders as virtual directories? I'm so confused on all of this. Do I just copy the folders and files over and thats it? It has Plesk to use for the control panel. I know I have to set the directories to run as application but is there anything else?