.ASPX pages markups are opening in web browser - asp.net

When I double click on .aspx pages in my web application project in VS2010, instead of showing the mark up in the ide the .aspx pages are opening in the web browser as shown below. The same is happening when I run my application it opens all the .aspx pages in the web browser along the application url i.e., http://localhost123456/default.aspx. I have to close all the other pages except the http://localhost123456/default.aspx to run/ test my application. Not sure what would cause this to happen. I am not able to find any solutions so far, any help is appreciated. I used the option View Markup (Rightclick on aspx page -> view Markup) to see the markup for now.
Update
As per Mike's answer I checked the options under Open with... and I do have a Internet Explorer (Default) set as shown in the following image. Not sure how did it got there.
Deleting the Internet Explorer (Default) option might be cumbersome if I have lot of .aspx pages , if there is a way to remove this option at once for all .aspx pages rather than right clicking on each and every .aspx and remove it that would be great.
As per #JB King suggestion I did checked the file properties and all the .aspx files are set with Opens with: Microsoft Visual Studio option as shown it the image below.

Right-click any .aspx file in the project, select Open With...
In the screen that pops up, select Web Form Editor, then click the Set as Default button.
Not sure how you got Internet Explorer as an option here, but if it is there, you can just delete it. It's not applicable for loading the aspx from disk. Rather, to see the rendered page in IE, you'd do View in Browser or Browse With... (in which you can set your default browser, as well).

Your address bar shows you're loading files directly from disk. This won't work. ASP.NET is not lilke static HTML. ASP.NET applications must be run from within a webserver. Install IIS and ensure ASP.NET is installed and configured, or use the Debugging Webserver (IIS Express) in Visual Studio.

If you look at the properties of the file, there should be a line of Opens with: that is where you want to have Visual Studio rather than Internet Explorer as the issue is with which programs are mapped to what file extension. Microsoft instructions if you want those as specific steps to do.

Related

How to open specific web page in ASP.net that I'm working on or find pages that referring it in Visual Studio 2017

I've edited an ascx.cs page which I thought was relevant. When I ran the service to debug that code it wasn't the right place - The breakpoint didn't stop the service.
I know how to find the right page to edit but now I want to see what did I edit.
How can I open the page or find which pages are referring to it so I could check it also?
Have you "set as startup" that project already ? then try setting that page aspx.cs as "startup page".
After setting above both , your project will start that same projects same page that you have set up as startup.
Alternatively you can type link to that manually in address bar to get there.
While trying to set it as startup page I've found out it ascx and not aspx file. So if You want I wanted to see the edits I would need to load that page as asp controller.

IIS smooth streaming does not play a video on asp.net MVC 4 with Razor

I am trying to get a basic demo working but can't succeed, I've spent hours and hours on it..
I am building an iis smooth streaming player with no controls at first that auto plays the video, I am using "MMP"- Microsoft media platform which was formerly "SMF"- Silverlight media framework, the example I am using to build a smooth streaming player is here on the middle of this page: http://smf.codeplex.com/documentation
A brief explanation of the issue I am facing:
I am sure I got everything right in terms of the player itself, I got the .ism file, i can view its manifest if I browse to it with the browser, I can even get everything to work and play the video in an html file that is running straight from an IIS website.
another key note: I can also run any test silverlight application for example, the main form with a button and a few radio buttons and I do get this application to run and display. the problem happens only when I try the smooth streaming player, it gives a black and blank page for the whole page and right clicking shows "silverlight".
so the problem starts when I try to run it from a Silverlight application that is hosted in an asp.net MVC 4 (with Razor) application.
I have an asp.net MVC project in visual studio and then I add a silverlight application to it and choose to host it in the MVC application, then I follow the same routin as for the silverlight application player building and it even renders and plays the video on the visual studio's silverlight XAML design page. I build the whole solutio and then I get a "silverlightApplication1.xap" file in a "ClientBin" new folder on the MVC application and also a test html file and an test aspx file again in the MVC application.
if I make sure the linking is correct I can take this html file to another IIS website and run it from there and it works and plays! but if I try to run it straight from within the application (view in browser) for the html/aspx files it says that it's not running on the platform/fabric of the website and for the silverlight application itself it opens the same blank silvelight application with a black screen and also a URL of file:// and not http://localhost.. etc', so what I was trying to do for a long time is to make the silverlight application work as a view in the MVC application.
so I took a view and deleted everything in it and gave it a property of Layout=""; (nothing) and then I put the content of the test html file the SL application produced earlier, modified the value for the silverlightapplication path etc', when built and ran, the page comes up, even the application comes up as I see "Silverlight" on a right click of the mouse but the whole screen is just plain black again and it doesn't play the video.
I had the .ism file on anther location or a an entirely different location like another online website.
I also can't get to view the manifest when I run the MVC application it says its 404 but I am not sure if it's an MVC platform thing that it won't let me get to it or it's just not getting to it but the files are there and the URL's are correct both in the code and also in the URL i am putting in.
I have also came to the understanding that I might need to make sure the silverlight application is allowing cross domain traffic and it has a Client access policy like seen on this page: http://msdn.microsoft.com/en-us/library/cc838250(VS.95).aspx , so I've added two XML files to the root folder for these two issues. trying to figure out what's going on with firefox's web developer gives nothing as for what happens..
Please Help! Thanks! :)
Ray.
I don't know why and I have tried everything+making sure I get the manifest content if i browse to it.
it just worked with this URL for the ism file:
http://video3.smoothhd.com.edgesuite.net/ondemand/Big%20Buck%20Bunny%20Adaptive.ism/Manifest
there was no need for cross domain xml and Client access policy xml.

Visual studio pulling a cached page

I think my visual studio is pulling a cached version of a webpage. See I am putting in code in the page, but when I run the website it never shows up.
And if I delete parts of the webpage, they still show when I run it.
I tried to rebuild but it still doesn't work.
When you say "putting code in the page," are you referring to the markup (aspx/ascx/cshtml/vbhtml/etc), or a code file (.cs, .vb)?
If you're modifying the code-behind file (webforms) or a controller (MVC), and you're (hopefully) using a web application project instead of a website project, you need to recompile the solution for your changes to take effect.

How can I get chrome to stop caching when working on an aspx file in visual studio

I'm currently editing some html/css within a aspx file inside of Visual Studio 2010. I'm using Chrome as my browser. When I make changes inside of Visual Studio and save/ctrl + F5 to run it frequently fails to load the new updated .css file due to pulling old cached versions of the CSS.
I've used visual studio as my primary HTML editor before but when I work with pure html/css files I just save and refresh the file in chrome and it will refresh the updated css 100% of the time. I've only started to experience this problem when working with aspx files and running things via ctrl + f5. Anyone have any ideas of how I can fix this?
Go to project properties, Web tab
Choose Start External Program in the Start Action section
Paste or browse to the path for Google Chrome (Mine is C:\Users\Chris\AppData\Local\Google\Chrome\Application\chrome.exe)
In the Command line arguments box put -incognito
If you would like the browser to open a specific page, then you will need to set the Visual Studio Development Server to use a specific port (ie 4066) then change your command line arguments to include that address, for example: -incognito localhost:4066/Default.aspx
Incognito Mode should prevent caching between sessions and even tabs.

Changing the Default browser to debug in an ASP.NET MVC 2 Project

I just created my first MVC2 project using the standard template. I need to be able to change the default browser for my project to test in IE (I use chrome as the default on my OS).
Unfortunately, the right click on default.aspx suggestion which worked in MVC1 can't work with these new projects as they don't have that file.
I was able to click on the Default.aspx (this is a MVC2 project) file and choose any of the browsers installed in my system. Are you sure it's not working for you?
If for some reason you don't have Default.aspx you can also add one, can you not?
If not, you can add a static .html page and use that as well.

Resources