I have a index.aspx in the project root but the solution explorer does not show the file.
I first started out with a html file, then I wanted to convert it to an ASP file. So I pressed save index.html as... and choose index.aspx as the new file name. But then I started getting error windows when editing the index.aspx. I noticed index.html was still in the root of the solution but did not show in VS-2013 solution explorer. So I figured I get rid of the index.aspx inside the solution explorer but both files disappeared from my disk. I somehow managed to retrieve the index.aspx but I cannot get it in the solution explorer. When I open the file manually the error windows are gone but I'm afraid I might have broken a link I'm unaware of in the program by deleting it in the Solution Explorer.
-Edit-
I could just create a new webforms file and copy the contents but the issue described above feels strange and unexpected. I like to have it clarified.
You've deleted it from your solution.
Right click your solution.
On the toolbar at the top of Solution Explorer find the "Show all files" icon and click it. You can now see all files on the file system, not just those included in your solution.
Find the file, right click and include it in your project. It'll have an icon that looks like this:
Related
So I am editing a website for an NPO, and I am using brackets to do so. Before today, live preview was fine, and showed the whole website. Starting today, when I open live preview, the website looks blank. However, when I use dev tools, I can see all the boxes in the site highlighted when I hover over its code. I am not sure what is happening, as I am still using the original code of the website.
I had the same problem suddenly and another threat helped me: Brackets - Live Preview not working
I tried this: Open Brackets > click on File > Open Folder and then choose the right folder, as in your local host server for your files.
So if your folders for all the files and your index page are in one overall folder (as example called "main" - C:\main) choose that folder and click open.
I had the problem that it didn't work because it wasn't directed to my "main" folder but a sub-folder, so it did not have access to all the .css and .js etc files.
I am currently using IIS to host a simple website, and would like to know how to enable the 'Global.aspx' file? I need to know where I would define it, as all the tutorials talk about using Visual Studio, which I am not using.
File Global.asax should be placed on the root directory of your site. There is nothing else to do besides adding required code, you put it there and just work.
Just right-click on the project name displayed in the Solution Explorer, and choose Add New..., then choose Global.asax from the list displayed in the new popup window. It goes to the root of your application.
Here is further information: Where is the Global.asax.cs file?
I have upload control on my asp.net page. I upload pictures in folder cars and they show in windows explorer when I open that folder (cars), but in Visual Sudio they act like they not include in project ( that is the reason why they don't show on image control which point to some of them. What did I make wrong ?
Uploading the images in the web application will never make any changes to your project. You will have to add them manually if you'll need them there. But generally these are pictures added by your user so the would just be in the file system - not really part of the solution, are they?
If you have choosen a webSITE then it will allow this, but not if a webPROJECT is selected.
I didn't find this on net, but I had two projects, and the one which was allowing me to show uploaded files was a website.
You have to click the refresh button at the top of the solution explorer in Visual Studio for it to show changes to the files.
You have to click Refresh button. Also ensure that "Show all files" icon is selected. And finally, you will have to right click on the files and select Include in Project. That way it would become part of your project.
If I may ask, what exactly are you trying to achieve in your application? The reason I ask is, if there is an upload happening in your application, you shouldn't need to include the files in your project to refer to it from code.
I created a C# web project with MSVS 9 and thats all i know about my configurations.
In my browser i can access any aspx files i have in my project. However when i use http://localhost:3288/img/test.png i see nothing. The working directory is ./root, the png file is in ./root/img/test.png How do i have ASP.NET display my images and everything else in the folder? (and subfolders).
Is the .png included in the solution?
When you hit the "play" button your essentially starting up a new website ( localhost:2383 ) so if its not in the solution it won't be copied over to the new, temporary, website that the debugger attaches too.
If this is the problem a quick fix is to hit the "Show all Files" button on the top of your solution explorer, this will show all the files in that folder on your hard drive. Then right click on the .png you want to include and hit "Include in Project".
Based on your comment your only solution is to actually create an IIS site for your solution with the root dir the same as your web project. Then in the project properties you'll have to tell the debugger to attach to your local IIS instead of visual studios. Not sure the exact click path, right click on your project and go to properties, look for debugging options.
Give a look to the ASP Image control , you can specify paths starting in your app root (~):
<asp:Image id="Image1" runat="server"
ImageUrl="~/Images/image1.png"/>
Or you can use relative paths to the page that are displayed.
Check this article about ASP .NET Website Paths.
I've been getting an error recently while debugging an ASP.NET application in Visual Studio 2008:
'Error connecting to undo manager of source file XYZ'
Any idea how I can get rid of the error?
Even simpler:
My experiment consisted of simply opening the designer.cs file, typing a character somewhere in the file, deleting the new character, saving the file and recompiling.
Found on That One Developer Blog and it worked perfectly for me.
Wouldn't you know it; just after I post this I find a workaround in Scott Hanselman's Blog, in the comments:
1) Right-click the designer file and select delete
2) Right-click the aspx file and select Convert to Web Application
Thanks to Matthew, whomever you are.
I have face the same problem. And I solved it by exclude this file from project and rebuild solution. Then include this file again...DONE!
GOOD LUCK!
I faced the same error now. I had to just open the designer file while editing the aspx file and once done, save both. You don't even have to type any text in the designer. That did the trick!
this one has worked for me:--
"Open desiner.cs file Type some text in it Delete the text you have typed. Save and build the application"
Thanks a lot Jitendra Kumar!!
Open desiner.cs file
Type some text in it
Delete the text you have typed.
Save and build the application.
*** I know this is an old question, and already answered but i'am adding my answer , hopefully it would help someone
In my case the referred file was .cs class, and since there is no .desiner.cs file, i needed another solution
so the solution for my case was to navigate tho the solution folder in windows explorer and delete the .suo file , reopen the solution and rebuild
Closing the solution and deleting the Temporary ASP.Net files directory fixed this for me. [link]
I got this error when i double clicked an asp.net button by mistake and removed it afterwords in the aspx file and .cs file but not in the Designer.cs file. Make sure all the three got files got updated.