I'm a noobie when it comes to VS, specifically VS 2010. I'm trying to learn MVC 2.0. If you're developing a pure MVC project, it seems like most of the toolbox is not useful. Shouldn't the IDE hide controls that aren't useful? Specifically, I'm looking at the AJAX extensions like Timer and UpdatePanel, but it seems like a lot controls more would require postback.
alt text http://www.freeimagehosting.net/uploads/6c63317805.jpg
You are correct.
The ASP.NET WebForms controls in the Toolbox are pretty useless during ASP.NET MVC development. While it may be pinned by default, you can choose to hide it from the 'View' menu.
Related
In Visual Studio versions prior to VS2019, .NET framework 4.7.2, if you wanted to design a MenuStrip, you just added the MenuStrip to the form and start typing the ToolStripMenuItems. Like this:
I've recently moved to VS2019, and started to use .NET 5. If I add a Menustrip, I get an empty strip, which seems not easy to edit (I colored the background of the main form, to clearly see the white menu strip)
My question is: how to add ToolStripMenuItems?
I see the little arrow on the right, and I can select Edit Items, but to add a menu that way is quite cumbersome.
If I open an old solution in VS2019, I can edit the menu as I used to do. So it's not VS2019.
If I create a new VS2019 project using an old .NET version, I can't edit the menu, so it's not the .NET version
If I copy paste InitializeComponents from an old project to a new .NET 5.0 VS209 solution I cannot edit the menu
So, how to edit the menu? Is edit items really the proper method to edit your menus from now on?
I believe that the MenuStrip editor experience difference comes down to .NET Core vs .NET Framework.
Edit: .NET 5 = .NET Core vNext
We covered MenuStrips while we were doing WinForms in my C# class and this exact question came up. .NET Framework solutions allow you to use the convenient editor as you have demonstrated. .NET Core solutions do not.
The easiest way I found to build out my MenuStrip items when in .NET Core was to click on the menu strip, then there is a property called "Items" which is a collection. In the properties pane, you can click the three dots button to bring up the Items Collection Editor:
Here you can create new ToolStripMenuItem objects to build your menu.
Possibly related post, others suggesting this is a Core vs Framework issue: MenuStrip not allowing to create menu
This issue has been fixed
in Visual Studio latest release v16.10: 05/25/2021 (https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes). I have tested this both in net 5 (current) and net core 3.1 (LTS).
Demo:
https://youtu.be/3s55hWrHx4U
You might have used the option that says "Windows Forms App."
This is wrong. You should use "Windows Forms App(.NET Framework)." This will let you edit the menuStrip control the easy way.
I'm using Expression theme in Visual Studio 2010 Ultimate on Windows 7 operating system. (Note: Actually, I'm not sure this problem occurs because of the dark theme) A few days ago, I decided to learn ASP.NET MVC 4 and tried to create a small web application. In Visual Studio, I followed this instruction and created a new asp.net mvc 4 web application: File->New->Project->ASP.NET MVC 4 Web Application.
Everything was perfect. But when I opened the Login.cshtml file, I couldn't even see the razor syntax (expressions which started #) because of highlighting. Take a look:
Even if I select all the text with CTRL + A in Visual Studio, I barely see the syntax.
Because of that, I can't even start to learn asp.net mvc. I started to look for a solution for this situation on the internet, but I couldn't find any useful answer. In Visual Studio, I looked the Tools->Option->Font and Colors option, but I couldn't find anything for this either. This problem shows only when I'm working in a View (for the Razor). There is no highlighting problem in Model, Controller or any other code files.
User ray247 asked a question close enough to my question called Where can I change the Asp.net MVC 3 Razor syntax hightlighting in VS10? but I still can't find a solution. I don't want to stop using my dark theme. It's really good for my eyes.
You should be able to change the text background for Razor code by:
Opening Visual Studio Options (Under Tools -> Options),
Selecting "Fonts and Colors" (Under Environment in the treeview at left)
Changing the dropdown box at top to "Text Editor" (if that isn't the value already),
Choosing "Razor Code" from the "Display Items" listbox, and
Changing the background color to your liking and clicking "OK" to apply the change.
There's also an "HTML Server-Side Script" setting that controls the background color of the Razor code delimiters (the # expression and similar expressions that mark the beginnings of code blocks.)
HTH,
Clay
how well can LightSwitch work together with Blend? I saw in some videos that you can use custom Silverlight control in LS and naturally I can create them with Blend.
But can Blend in itself be used to customize the screens of a LightSwitch application? It seems LS doesn't use Xaml but puts all screen in an application.lsml file which is invalid for Blend. Is there support coming here?
Thanks in advance.
No. You will never be able to customize the LightSwitch 'Screens' in Blend, because as you have seen, they live inside the application.lsml file. If you build a Shell Extension, you could use Blend to do the basic layout, but most of the work is in C# or VB. For a Theme Extension, you could certainly use Blend to edit the Theme Visusl Pallette Resource Dictionary. See this link for the a cookbook guide to building the various types of LightSwitch Extensions: http://blogs.msdn.com/b/lightswitch/archive/2011/03/16/lightswitch-beta-2-extensibility-cookbook.aspx. There is also now an accompanying Visual Studio project template available for Beta 2.
LightSwitch works fine with Expression Blend, but only for custom Silverlight controls (Expression Blend will throw an error that it can't load any LightSwitch projects that are part of the solution, but it will load any Silverlight control projects).
You cannot edit any of the automatic LightSwitch UI, but you do not have to use any of the standard LightSwitch UI if you need changes.
I would recommend creating Silverlight custom controls not LightSwitch extensions, the difference is that a control extension has a design-time experience in Visual Studio and is MUCH harder to create (Silverlight custom controls are actually very easy to create).
See this article for an example:
http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/2/Creating-A-LightSwitch-Custom-Silverlight-Control.aspx
Hi I am creating an application page for SharePoint 2010
But i ran into a little issue.
First I create a Empty SharePoint Project then I added an Application Page item to the project
When i tried to add controls i am only capable of doing so in the Source View
Some one knows how to enable the design view for this type of project?
Thanks in advance.
Design view may not available for SharePoint Developers in VS.NET because NOT all dependencies (and most importantly master page and other scripts, styles used by master page) are not available to VS.NET's project environment. So VS.NET may not be able to render the page correctly.
The Design view of the designer is disabled for application pages.
You can only design the page in the Source view of the designer.
See
http://msdn.microsoft.com/en-us/library/ee231581.aspx
here is a trick for this little problem:
add a user control to your project. copy all the markup code over to this user control. design away, then copy the markup back into your application page to start refining your code to work as a sharepoint item.
The inclusion of DataGrid and DatePicker controls was announced for WPF in Framework 4, but when I access to Visual Studio 2010 and I create a WPF project, I don't get these controls. What did I miss?
Thanks.
I hope I understood your problem, so here we go...
Instead of the DataGrid you can use the ListView with ListView.View set to a GridView. After this you have to create a couple of GridViewColumn objects, set their binding and then add them to the GridView.
I have an example of doing this (but i don't think it is the best one, because i'm kind of new to this programming stuff). If you want I could post it here.
Have you made sure the target Framework is set to be v4? They should "just show" in the toolbox if you're targeting v4 of the framework.