How can I access "Visual Studio Conversion Wizard" for a WebSite? - asp.net

I'm using this article to convert my ASP.NET 2.0 web application to an ASP.NET 4.0 application.
However, the article states that I will be prompted to change to .NET 4.0 when I open up my project/website.
As I've previously declined this dialog I'm not longer being prompted.
I've read this question which states I should click on the Properties tab of my solution, but I only have "Properties Window". Perhaps this is just for Projects/
How can I get the conversion wizard to reappear for my WebSite?

I haven't been able to get the Conversion Wizard to reappear, but I have been able to convert to .NET 4.0 by:
Right Clicking on my website
Selecting Property Pages
Then go to Build tab
Change Target Framework
This made all the changes to my web.config automatically just like the conversion wizard would.

Related

asp.NET MVC Identity login page - Where is this pointing to?

I just started some tutorials on MVC (I'm an old .net framework programmer).
In the pre-configured ASP.NET MVC Web App setup (in Visual Studio 2019), I'm trying to find where the actual Login page is (the HTML). I assume this is pre-built into Microsoft Identity. Is there any way to change this login form?
These are scaffolded items Microsoft generated for you for using identity users. You have to follow some steps to add them to your project.
Press the right mouse button on your project.
Press Add
Add a new Scaffolded item
Select the identity options and click add.
Now you can a list of pages. You can select all the pages you want to use in your project. Select the data context dropdown value. The default value will generate an Application db context class for you and install the necessary packages.
Now you can see you have some extra files in your project/Areas/Identity/Pages folder. you will also find a folder named 'data' that implement Applicationdb context.

Convert Legacy ASP.NET Application to MVC3 and HTML5

I have an ASP.NET application which works just fine, but which is becoming unwieldy. I would like to incorporate MVC3 functionality in it for any new pages, and gradually convert all the old pages. I plan to use the Razor syntax.
I've got it working. I can serve up pages just fine. It was a bit of a battle, but things looked good. I believe I have all the directory structure and the referenced DLLs.
My only real problems are with the IDE:
I cannot select "Add Controller.." when I right-click on the Controllers folder. Ditto for Views, and "Add Area..." from the project right-click menu.
I cannot add template items related to MVC3 (or MVC2, which I also have installed).
I also cannot validate HTML5 (all tags are invalid), but I think this is a separate issue, because this functionality doesn't work on my MVC3 projects either.
I would not even know that these things were missing if it didn't work perfectly for a project created as an MVC3 project (with Razor syntax), so it must be something specific in the solution or the project, but I cannot find it anywhere.
My question:
Where do I change this so that the IDE acknowledges it as an MVC project?
The reason why the menus are not coming is visual studio IDE do not consider this as a real ASP.NET MVC project because the project file does not say so. So we should update the project file to include the project type guid for ASP.NET MVC and then the IDE willl start supporting the menus specific for ASP.NET MVC type project.
Step 1
Go to your solution explorer and unload the existing ASP.NET project by right clicking and selecting “Unload Project”
Step 2
Right Click the Project in solution explorer and select “Edit your project file name“
Step 3
Add the below entry to it inside the ProjectTypeGuids section
{E53F8FEA-EAE0-44A6-8774-FFD645390401};
Save. Reload the Project and you will be good now.
I clearly explained it here in a blog post.

Windows Forms message box doesn't work in published ASP.Net application

We're developing .Net Application using asp.net and C# and .Net Framework 3.5.
We are using windows form message box in a .Net application.
This windows form works great on the debug mode but once we publish the application this message box won’t work.
We are referencing System.Windows.Form.dll in order to use the message box features.
Kindly advice if we need to register this DLL or follow some configuration steps in order to solve this problem.
Thank in advanced,
Jad
Don't use MessageBox in a web application. It will show up on the server console, there's nobody around to click the OK button. I assume that ASP.NET has some counter-measures against it, given that it is such a serious denial-of-service attack.
If you are using unreferenced classes a project/solution is usually not even compiled.
So probably the problem is in another place. Are you sure that the code that should display the MessageBox is executed?
EDIT: When you develop web applications (ASP.NET), as described by you in comments, you cannot use Winforms MessageBox.
Try showing it with javascript, if you really need it
Response.Write("<script>alert('This a message')</script>");

SharePoint Webpart and ASP.NET User Control

I am developing SharePoint Web Parts for MOSS 2007 on Visual Studio 2008. Up until now, I've been adding all my controls by hand to the code behind... but an earlier post suggested I could use the designer to create an ASP.NET User Control, then add it to the webpart, and everything is happy... See figure 5 for an example.
However, I can't seem to add a new ASP.NET User Control to my MOSS WebPart project, the template just doesn't appear. If I create a WebApplication and make my User Control in there, I can't see any SharePoint templates to add to the project. Finally, I tried copying a simple aspx file and its code behind to my webpart directly, and adding them as an "existing component"... but now the designer won't recognize the aspx file. Next, I'd probably try adding two projects to my solution, and just referencing any dll's from the ASP.NET application...
So how do I get an ASP control into my SharePoint WebPart project so that I can use the Visual Studio designer?
Edit: So here is a partial solution where the ProjectTypeGuids needs to be modified. When I try this, it gives me an error saying "The project type is not supported by this installation". I am using Visual Studio 2008.
Try reading some of the following tutorials:
http://www.google.com/search?q=create+sharepoint+web+part+as+feature
What type of functionality and/or display are you trying to create? You may not even need a user control. For example, create a very simple "proof of concept" HTML table as a custom Web control (Web Part). Create it as a Feature and use the Solution Framework to deploy it:
Create a Web Part with VSeWSS 1.3 - Part I
Create a Web Part with VSeWSS 1.3 - Part II
Scott Guthrie offers up resources here on Web Parts and User Controls:
Writing Custom Web Parts for SharePoint 2007

Migration: ASP.NET 1.1 to ASP.NET 2.0, broken postback

We just recently migrated our web application from .NET 1.1 to .NET 2.0.
The web application was originally written in .NET 1.1 using Visual Studio 2003. To migrate it, we converted the solutions to VS2005.
Aside from some minor problems like RESX incompatibility and broken Calendar Controls, the Web Application worked.
However, we just tested it today and some postback functions are suddenly broken. In particular, the "File Browser" one. When the user clicks on the browse button, a new window will open (a custom page) that will allow him to browse for the file, the PATH will then be passed to the parent page then saved on a textbox, then it will postback to do some validation on the path. However, on POSTBACK, the path that was stored in a textbox is now gone and was replaced by the "default" path.
Is there something that we should watch out for in migrating from 1.1 to 2.0 that can break postbacks?
Thanks! :)
This is a design issue in ASP.NET 2.0.
My textbox was set to readonly. This behaviour is by design in ASP.NET 2.0 and it has been designed with the idea that a ReadOnly TextBox shouldnt be modified in the client side by a malicious code.
Workaround:
Instead of setting the readonly property during design time, you should set in during runtime.
TextBox1.Attributes.Add("readonly", "readonly");
References:
http://www.dotnetspider.com/resources/3120-ASP-NET--TextBox-Ready-Only-losing-client-side-changes-values-across-postback.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.readonly.aspx

Resources