Contents tagged with VisualStudio
The secret of 'Convert to Web Application'
Probably you, as I did, wondering why 'Convert to Web Application' option is available only on Web Application project.
In first thought: there is no sense to convert Web Application to Web Application.
I have tried couple of times to use that on an existing Web Site, but with no luck at all."This is totally useless" - I thought to myself.
Then recently I found how it can be used and it appears to me reasonable to have that option on an Web Application. Maybe the name is not very helpful and push your thoughts in different direction, but nothing is perfect.However, here is the case I used that.
Recently, I have started to spend some time on updating my personal web site http://artembg.com
Mostly because I want to make it more useful and be able to add some other stuff there, not just projects.
Originally I have used Web Site project, but now I decided to go for Web Application and adding support the "top of the pop" ASP.NET MVC in same context as my good old existing WebForms.So, I have created a Web Application project and moved my existing WebForms to the new Web Application project.
When I tried to compile the project I got a lot of errors. Errors which at first surprise me a lot.
In the code-behind were missing all the server-side controls references using on the WebForms.For example:
Error 49 The name '_txtEmail' does not exist in the current contextThen I found what's wrong - I was missing all the *.designer.cs files for all the WebForms I have moved to the new Web Application. Where actually all server-side controls are defined for WebForms in a Web Application.
Looking around for some time and thinking what I can do, my attention was grabbed by 'Convert to Web Application' item in the context menu. I used it and here it was, magic happens I got my *.designer.cs file generated for the WebForm and errors gone.That's it. I found what and when to use that for and that made my day.
So, if you have same problem I hope with this post to make your day too :)Check out the short sample video here.
Happy coding ...
“Fixing” Visual Studio 2010 HTML snippets
Visual Studio 2010 is out now.
It is great the new Visual Studio 2010 allow usage of code snippets widely now.
Apart of that, the cursor is goes at wrong place after inserting some of the HTML snippets, which breaks the nice continuous typing experienceHave same problem like me?
Do you know you can edit and "fix" them.Check out this short video, where I for example change the standard textbox snippet
Hope this helps,
RegardsVisualStudion 2010 Javascript Outlining 1.0
As a Web 2 developer I found myself dealing with fast growing JavaScript code files.
And I really missed the code regions in Visual Studio, which is a nice way to organize the code blocks and focus on reasonable small amount of code.
There are some macros available out on the web for placing a regions outlining in JavaScript code editor.
I was not fully satisfied with macros and the fact I have to manually run them (even with a shortcut keys) every time I open the JavaScript file.
Thus, I have spend some amount of my time and came out with a Visual Studio 2010 Editor Extension for JavaScript Oulining.
Even, if this first version is simple as functionality it gave me much better JavaScript code experience.
So, I decided to share it with you guys and hope it helps you too.Please, find the visual studio package here
EnjoyVisualStudion 2010 Javascript Outlining 1.2
A support for CSS content type was added in order to use outlining in CSS files, as well.
Features
- Outlines CSS codeblock regions for the code placed between { }. The closing brace is places on a new line and there is not another opeing brace on same line.
- Outlines custom regions defined by:
- /#region/ - /#endregion/
- /#>/ - /#</
Samples
- code block
body {background-color: #AAA;
font-family: Verdana;
font-size: 11px;
}
- long custom region definition
/*#region Test */body {background-color: #AAA;
font-family: Verdana;
font-size: 11px;
}
h1, h2, h3, h4 {
color: #5377A9;
font-family: Tahoma;
}
/*#endregion*/- short custom region definition
/*#> Test */body {background-color: #AAA;
font-family: Verdana;
font-size: 11px;
}
h1, h2, h3, h4 {
color: #5377A9;
font-family: Tahoma;
}
/*#<*/