Visual Studio 2008 doesn't generate itself code for added control in .aspx.designer.cs - visual-studio-2010

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.

Related

Cant save BIML file in Visual Studio

I have just started trying to use BIML to generate my SSIS packages. Im currently using VIsual studio 2015 to do everything.
When I add a new BIML file to the project it appears in the Solution explore and I can open the file and edit it. But when I save and close and reopen none of the changes where saved. Is there a setting that i need to change in Visual Studio? Currently I have to edit this file through the use of Notepad++ or something similar.
Visual Studio ScreenShot
As a work around to this issue, you could right click on the file you wish to edit and choose XML (Text) Editor.
Sadly you'll loose intellisence for the C# code
If you open a file twice, once in the BIML editor and once in the XML editor then you can view side by side making your changes in XML but viewing nice formatting in BIML...

How to add new page in VS 2010 with tfs

I am completely new to TFS 2010 and am trying to use it for basic source control. I have successfully added an exsting project, however I cannot figure out how to add a basic new .aspx file. I know I am missing something completely obvious here.
Is there another product I should consider altogether? My needs are very basic and TFS seems to be complicated for what I am doing.
Thanks!
To answer your second question: if you think TFS is too complicated, then google an alternative and try it. Version control is not simple, though, and you won't necessarily make it any easier by changing products.
For your first question: add the aspx file to your project exactly as you normally would. If you do this in Visual Studio then the file will be added to your "Pending Changes" list in TFS automatically, and all you need to do is check in.
Right click on .soln in Source Control Explorer-->"Get Latest"
Open the .soln
In solution explorer, right click on your project or a folder -->"Add"
Right click on the new file once you've created it and "Check in"

How to configure Visual Studio (2010) to open aspx pages on code behind by default on double click?

The question says it all... its pretty simple, and it can be done by selecting the file and pressing F7 but I'm always double clicking accidentally and visual studio takes forever to open the design view page (even if its almost empty), but I just wanna go straight to the code.
Any tips?
I had this problem too. My solution was to change Visual Studio to open up pages in HTML view by default. Because VS doesn't need to format the page, this is MUCH quicker. You can see how to get Visual Studio to open pages in HTML view at http://www.wiseowl.co.uk/blog/s153/visual-studio-html-view.htm.
To tell Visual Studio 2010 to open files automatically in Source view,
Tools -> Options
Select the General section of the HTML Designer tab.
Choose to start pages in Source View.
Just incase Andy's link dies, the method to make Visual Studio open ASPX pages in HTML view rather than the default designer view:
Go to Tools -> Options. Select HTML Designer from the menu at left. Select "HTML View" for HTML pages, Active Server Pages and Web Form pages. Click OK.
This forces VS to open pages in HTML view, which for developers is usually the view we work in for editing ASPX templates. In addition, it addresses the original issue of this question, which is getting VS to open pages faster, since it doesn't have to render a designer view.
I think you are asking to configure VS2010 to take you to the .cs / .vb file when you double click on the aspx page, but you could also be asking about make it go to the html source view.
If you are wondering about the latter (html source view), here is a screenshot of what setting to change.
http://screencast.com/t/8UluCEUQr
I hope this helps.

Controls do not show up when dragging from toolbox

When I drag controls from the toolbox to an .aspx page or the designer for that page nothing shows up. I am using Visual Studio 2010 with an existing website project.
** Update
It seems to work now... I'm not sure if this was specific to one project, or a combination of things.
Is the project under source control or in a read only state?
I think the project is so messed up it just doesn't work. If I start a new project it works, so I'm going to leave it at that

Visual Studio 2008 ASMX files

This is not technically a programming question but it does specifically relate to a heavily used programming tool so i think this is the correct place for it.
In Visual Studio 2008 if i have an asmx web service and i double click on the asmx file it opens the asmx.cs file, this is eminently sensible seens as there is just a single line directive in the actual asmx file. However if i click on the asmx.cs file directly, it tries to open it in "design" mode, i.e. the mode for aspx files where it shows you a visual designer rather than the markup. The result is you either get a grey screen saying that this file type cannot be viewed in design mode or you just get a wierd visual studio exception handling page. All i'm doing is double clicking on the asmx.cs page. I can post screen shots if anyone is interested. I have observed this behaviour on my coleagues machines as well so it does not seem to be some wierd quirk on my particular install. Has anyone observed this behaviour? can anyone reproduce it? Is it a bug? Is there a service pack that fixes it? Is it some wierd setting i have been unable to locate. It is not a show stopper becuase double clicking the asmx file opens the relevent code file but I would like to fix it if possible.
The .asmx file is essentially a markup file that points to a code-behind file. Since the markup is never changed, the (pre-VS2008) VS developers thought it was a good idea to display a warning screen instead.
To avoid this warning screen, you can right-click the .asmx file, select Open with... and set the Source Code (Text) editor Editor to be the default. In VS2008 and VS2010, the code-behind will display when you double-click the .asmx file in the future.
If you want to view and/or edit the markup of the .asmx file, simply right-click the .asmx file and choose 'View markup'. Not sure if this works in VS2008 (don't have it here), but it works in VS2010.

Resources