I've been creating a new webforms website in c# and been working exclusively in source view until yesterday when I wanted to create a method for a button click for the only dynamic part of the site and I was confronted with this:
I've never seen this before! Every page is the same and it reoccurs on another machine with VS 2013 The site renders fine and publishes without issue. Other websites work fine, so it's got to be this project.
I don't know if this is a separate issue or is part of the same problem, but I managed to link up the button to a method using Resharper, but data from textboxes are not passing to the method, which again I've never had before.
It's a 30 page bootstrap site (replacing an old site) that I've nearly finished! Am I screwed??
Any help would be appreciated.
EDIT:
It's not that I'm worried about seeing the page render in design view. I never use it. I just want to be able create the button click event method. At the moment the button click is just reloading the page and not passing form data to the method.
This happens due to improper termination of the Visual Studio processes due to which the files get corrupted for which you might need to use system restore or re-installation of the product. Still assuming that its caused due to some setting mismatch we can perform the following steps.
1.right click on an html file listed in Solution Explorer
2.in dialog box that opens click on: Open With...
3.click on: HTML (Web Forms) Editor, AND on the right pane click on Set it As Default
after this action all html files that you open have options: Design...Split...Source.
Reference : http://social.msdn.microsoft.com/Forums/vstudio/en-US/25d6c666-6216-4fa8-992b-f9bb088dfc7d/visual-studio-2013-missing-design-source-and-split-buttons
Related
I'm using Visual Studio 2022 Community Edition w/ .Net 4.8 but the same behavior presents itself with Visual Studio 2019 Professional w/ .Net 4.6.1
What is happening is that I can clone a new Feature branch from Git to my local system and when I launch it everything is fine. The main application form presents itself just fine and I can get to all of the buttons, dropdown lists, file selectors just fine. The minute that I had any new control to the form when I subsequently launch the application the form is cut in half and I can't get to any of the controls and maximizing the form doesn't help either. When I inspect the designer code things have been drastically moved around in the post modification file as compared to the original. I've included sample information--
Original Form Display
Post Modification Form Display
Designer Code Compare Sample
A team member can take the same code base and add controls without any problems. Additionally he took my codebase which runs fine on his system compiled it and sent me the executable and when I launched that executable I had the problems with form display that my solution exhibits.
One final not thinking it was my laptop I got a brand new laptop and I'm still seeing the issue. I also created an AWS EC2 Instance and tried it there with the same behavior.
We're all stumped here none of us has ever seen behavior like this. We're hoping that someone in the Community has seen this sort of thing before and can shed some light on the issue.
Thanks,
Bill
I'm facing a problem of adding new controls on a form.
While adding controls on my form, I'm normally able to edit them and work with them in .cs files.
When I'm debugging, all new added controls vanish, as well as implementations (like properties) for old controls, and old controls, which were deleted, are still shown.
I have already deleted bin and obj. Problem still appears.
Searching for help!
Cheers
Edit: I checked other projects which are using windows forms too, and in those everything works fine
Just in case, are you using the "Save All" button to save your progress and then debug it ?
If your program is running without problems in debugger but is showing old things, maybe you havent saved your progress ?
Problem solved!
If you have opened your project, click on top "Create" and then on the task "create new -projectname-".
VS needs some seconds for running through the task but after that all implemented controls and task that has not been shown are going to appear. Furthermore all properties etc.
Is there any possibility to show our Form without starting debug?
I know there is designer preview, but I want to perform a quick test of form apperance (all of the popups, lists etc.) without building and debugging applicattion. The problem is when I add new form to existing application that has to log-in to external system - which takes time.
You could always build the new form in a separate solution and copy it over once you are happy with its performance/operation. That way you only need to compile the form and not the entire other project w/ login etc...
Whenever the "Reserve" button is clicked in my web application (ASP.NET with C#, Visual Studio), a small window should pop up containing detailed options to choose from (drop down lists with values, comboboxes, etc), with a "Next" link, and "Finish", in the end. Changing the values in these controls should update tables I have in the database (Microsoft Sql Server).
Could you point me towards a detailed and useful resource/example of this? I am already using a book for inspiration (Cristian Darie) written in the form of steps / explanations, but scenarios as just described are not included. What should I be looking for? "Using Pop up windows with Visual Studio"? Is what I described known as a popup window?
I don't know JavaScript, is that needed here? Been practising lately a lot with classes, methods, stored procedures, masters, user control type files, handling db tables through Visual Studio classes and methods, etc but still new to these (a month old basically). Thanks a lot!
it's not necessary to use JavaScript, but if you want anything a bit more fancy than just a regular popup window, javascript will be a good friend to you. As I see it it's basically four main ways of doing it:
1
Create a new ASPX file with the "details", send a querystring to the url of the details view in order to connect the popup with the data from the main window. a key to this is the "target" property of the html "a" tag. For example:
Details
2
Create a popup window with some custom properties (i.e toolbars window size of popup etc) using regular javascript. Look for window.open in javascript.
Example:
Details
3
Using jQuery to open the popup in a modal dialog fashion using a lightbox. For this alternative I don't have any example, but google jQuery lightbox, there are heaps of them. Use that with an AJAX-call and achieve your goals.
4
And at last, use ASP.NET AJAX Control Toolkit (look here:
http://www.asp.net/ajaxlibrary/act.ashx) Download and install, use the ModalPopupExtender (tutorial here: http://www.asp.net/ajaxlibrary/act_ModalPopup.ashx) from the toolkit, in which case you design your "details" view in a <asp:Panel> control and then using CSS and the ModalPopupExtender to display and hide the details, the looks will be like the lightbox but you don't have to create a separate ASPX page for this option, but you can use the same ASPX.
I've worked alot with all four options, and i tend to like the 4th alternative the best, but we all have our own taste.
Good luck, and feel free to ask away for more detailed information. :)
let's take this step by step. In order to send that information, I think the
easiest way would be to store the parameters as session variables and then reload them
when the popup is closed, you can reload the parent window using the "onunload" event in
Javascript, for example
<body onunload="window.opener.location.reload(true);">
This would in
itself reload the parent window whenever the user closes the popup. IF you want it to close
when the user saves changes (and your session variables are set), use this code in order to reload
the parent window and close the popup. Put this code in the code behind, just before the
end of your method that saves the data:
Page.ClientScript.RegisterStartUpScript(this.GetType(),"close","<script language=javascript>window.opener.location.reload(true);self.close();</script>");
To learn javascript, have a look at codeproject.com, they have a lot of articles regarding
javascript (among other things), often with example code. :)
I made a quick example here: http://www.4shared.com/zip/LPtR1gbx/pop.html
I would recomment using a <div> element rather than an actual new browser window.
It eliminates the need to pass the contextual information from the pop-up window back to the original window along with all the complexities involved with it (including things like the user inadvertently clicking off the pop-up window, clicking multiple times and thus bringing up multiple copies of the pop-up window, and so forth).
By using a <div> that "pops up", via controlled visibility through CSS or JavaScript, the entire context is kept to the same web page, making life so much easier overall.
In 'Data Source' window from where I can drag and drop data sources to a form, I can set the field to different control 'Textbox', 'Label', etc. But I used to be able to set them to some third party component (in this case Telerik's components). Just now I started to work on my project again, and these third party components do not appear there anymore.
I click on the choice list, customize ... I get the window 'Options' width 'Data UI customization' selected, there I used to be able to select Telerik's control, but again they don't appear there anymore.
How could I customize this ?
I ran into something similar back in December... apparently with some windows updated / service patches, it corrupted something. I couldn't even pick a UI control of my OWN. I even tried by creating a BRAND NEW project, created a single class and it would not appear in the toolbox to be put into a form anywhere.
By doing some digging, I came across a blog (don't remember where), but it directed me to do the following. Get to your Visual Studio Command Prompt. There should be one in your Startbar menus specifically under your Visual Studio icon group.
Once at the command prompt, do
DEVENV /setup
This apparently does some fresh "cleanup" settings and fixed whatever was stopping the classes from being displayed. As soon as I did, and re-started VS, the class libraries appears and able to be put into forms no problem.