I had a Visual Studio 2010 MVC 2 project with spanish characters in my views.
I converted the project to Telerik MVC 2 project and now I get weird characters in place of the special characters in my views during execution (they're shown ok in the aspx code in Visual Studio).
E.g.: I used to see this during execution:
I now I see this:
This only happens with the Master Page content.
In Visual Studio: where do I set the encoding used when saving/loading files? The Telerik conversion seems to have messed that up, right?
I don't know how did the Telerik conversion break that. But I've solved the problem this way:
Created a new master page named Site2.Master
Copied the content from Site.Master to Site2.Master
Deleted Site.Master
Renamed Site2.Master to Site.Master
Related
I'm doing an ASP.Net Core MVC project involving a lot of Controllers and Areas.
I often need to open anything from 3-5 copies of files with the same name - e.g. index.cshtml or similar from different views.
It is getting really annoying to work out which is which or just general quick management.
I've looked and am coming up blank - I've seen productivity power tools, but, all of these are within the same project.
Can anyone recommend anything here?
One way to see the full path would be within Visual Studio, by pressing
CTRL + Tab
You get a menu with all the open files. At the bottom it shows the file path of the highlighted file.
You can use my Tabs Studio extension with Disambiguator add-in that detects when two or more tabs have the same title and adds Visual Studio folder or project to titles for these tabs. And you can assign colors to tabs based on file path.
Visual Studio and Blend 4 Design Problem
I have a VS 2010 C# solution file that I am opening in Blend 4. The file opens with no errors, however if I attempt to build it in Blend the program lists a few missing references and then crashes Blend. Here is the issue that I am really trying to solve since I think I can solve the missing references in due course. Once the solution is opened in blend the Design tool for any XAML does not display at all. VIEW >> Active Document View >> Design View, etc. are all grayed out. What is the secret to having a programmer work in VS and hand off solution files for a designer like me to work on GUI in Blend. It seems MS has made this a difficult procedure to master.
It sounds like you created the project using the Class Library project template instead of the WPF User Control Library template. When you put these two project files side by side, you'll see that the WPF User Control Library project has this additional line near the top of the project file:
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
This is what tells Blend it can display a design surface for the items in the project. There's lots of stuff you can make in Visual Studio that cannot be displayed in Blend, so Visual Studio needs some way of communicating to Blend that it should attempt to load designers. Edit your .csproj file to contain the above GUIDs and I bet it will work.
I have a Web Application Project that I'm working on.
My solution looks like this :
./MyProject/
./MyProject/dataobjects.cs <- no intellisense
./MyProject/sqlquerying.cs <- no intellisense
./MyProject/default.aspx <- intellisense works here
./MyProject/default.aspx.cs <- intellisense works here
./MyProject/mypage.aspx <- intellisense works here
./MyProject/mypage.aspx.cs <- intellisense works here
Visual Studio 2010 doesn't give me any intellisense options when I work on non-code-behind files like Business Logic Layers and Data Logic Layers . In VS2008, I placed these files in the App_Code folder and intellisense worked fine.
What can I do?
Is there a specific folder I need to put these files in to get intellisense?
Found it!
Visual Studio was setting my code files as 'Content' instead of 'Compile' for the build option.
Here's an excerpt from the same question on MSDN forums for anyone who's interested:
if you're having
the intellisense issue, another thing
to check is the "Build Action" for
your code file... just look at the
file's properties and make sure the
"Build Action" property is set to
"Compile".
You may have a "Website" rather than a "Web Application".
In a Website non-page code files need to be either in App_Code or (ideally) in a separate project that is referenced.
You should have intellisense, regardless of where you put your class files. Is this a new VS 2010 project converted from a VS 2008 website?
Try right-clicking the project, and selecting 'Convert to Web Application'.
In a web application, You should have the aspx files, designer files, and code behind files. I have experienced similar oddities when converting a VS 2008 website to VS 2010 web application.
I added a control on my .aspx page and set Id and runat=server for it but, it doesn't render on my page when I open it in browser as well it doesn't generate code for it in designer file.
Try that:
1) Remove your_page.designer.cs file.
2) Go to the ASPX page and cut markup, then paste it.
This should force Visual Studio code generation from scratch.
Another try would be check that your control compiles. Sometimes the whole control doesn't compile and you can't add it to the page with success.
Finally, if non of these works for you, you can clean and rebuild your Visual Studio solution.
Matias's appraoch should work another way of doing this is:
Delete the designer.cs file that is causing issues
Right click on the aspx file and "make application" (or something to that effect)
This will regenerate the file.
Consider the feature in Visual Studio 2010 for snippets in the HTML Source view of a web page.
type a control name in plaintext with no markup or brackets!
... e.g. hyperlink.
Then hit Tab
Your web control has been auto-completed for you. It's up to you to fill in the other details that you need.
This works for form as well:
<form action="default.aspx" method="post">
</form>
This looks like a real time saver. This is supported in WebForms and ASP.NET MVC projects.
What other snippets are available in Visual Studio 2010 in the Source view of a page?
For the authoritative list of snippets, check out the VS2010 installation folders where the snippets are stored:
C:\Program Files\Microsoft Visual Studio 10.0\Web\Snippets\HTML\1033
There is one folder for ASP.NET and one for plain HTML snippets.
Also, if you use jQuery a lot, there is a set of jQuery snippets that you can add to Visual Studio as well.
Here are a ton (100's) of the short cuts in Visual Studio right from MSDN:
http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx
The one thing that has been around forever but a lot of people forget about is block selection done by holding down the ALT key and use the mouse to select a block of text. Great when you want to copy/cut/delete a bunch of code that is lined up but you don't want the whole line.
Yeah, this is a really cool new set of snippets in VS2010. Here are the articles I used to learn it:
Walkthrough: Using HTML
Snippets
Using HTML Code Snippets in Visual
Studio 2010