how i can change default browser when running .net projects - asp.net

net project then it runs in mozilla. I want to change that setting & i want in internet explorer, how i can do this?
Thank you.

From File menu, select Browse with..., and choose your default browser.
Be sure to have a web site project loaded and selected otherwise the option won't show up.

Just Right-Click on a folder or a .aspx file in your project and Choose "Browse with..." from there. Then set your desired browser as default via the "Set as Default" button and click browse. That's it.
Next time you start debugging the site will open in your default browser.

Related

CSS changes are not reflected even after changing version, hard refresh and clearing cache

I have an Angular application with CSS in it.I have recently changed the CSS and deployed it on server but it is not getting reflected in the client machines.
I have done the following things:
Clear cache and did a hard refresh (Ctrl+f5).
Changed the version number of the CSS file and redeployed it.
Opened developer tools and disabled Cache and reloaded.
Pressed F12, go to source and checked the CSS file if new changes are getting loaded. New changes are there.
When I opened the web application in a new machine, the new changes are getting reflected.
When can be the possible reason for CSS not getting reflected even after checking all the above. Is there anything which I'm missing?
is it a PWA (progressive web app)... ? in which case the data is served by service worker and not freshly fetched.
Go to
Chrome developer tools (press F12)...
Click on Application tab on
the left navigation, click on "Service workers" and 'unregister"
service workers...
going on the next option in the left navigation, click on "Clear storage"...
click on the "Clear site data" button on the right zone restart Chrome and check with Ctrl+shift+R
if you're using a CDN, you may have to purge the cache for this particular CSS file from there as well.
Make hard refresh (Ctrl+Shift+R)
or go to view page source and the open css file from it and make it refresh and then again make hard refresh...Your problem will be solved
Please clear the browser history of the application complete from begin and perform hard refresh and then try to login to your application
You can disable cache in development tool in chrome.
Go to Developer tool in Chrome by pressing F12, Network-> click on Disable Cache
I faced similar issue. This helped me. Hope it might help some one

.ASPX pages markups are opening in web browser

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.

How can I default to IE for testing my ASP.NET application?

Three fine browsers I have installed: the inimitable Mozilla, the traditional Internet Explorer, and the hot new Chrome. I love them all dearly, but when testing my ASP.NET application, I would prefer to do so using IE.
Please note, I've not deployed this application. I'm merely launching it from the Visual Studio project in which it was conceived. Would someone here be so good as to suggest a way in which I might specify the browser it launches in? Thank you.
Right-click on any .aspx page in Solution Explorer and choose Browse With...
You can then select Internet Explorer from the list and choose 'Set as Default' to make pages open with IE when you press F5.
Click and ASPX file in your solution explorer
Go > File > Browse with.. > Select IE then set it as your defautl browser.
Run your project.

CSS images not showing in ASP.NET MVC

In my ASP.NET MVC application, I am referencing background images via CSS. When I run it in the dev environment, they show up fine. But when I deploy it (using IIS 7.5) the images do not load at all. I have tried every combination of relative paths and background/background-image CSS tags, but nothing works. Here is my file structure and CSS:
File structrue:
Content
CSS file
images
image.png
CSS:
background-image: url(/images/bsb_header2.png);
I have also tried ../images/bsb_header2.png and ../../images/bsb_header2.png to no avail.
What is really strange is when I try to go to the image directly (i.e. www.website.com/images/image.png), I am redirected to a login page. Perhaps there is some access or security setting I'm missing? I haven't done anything with login controls yet (the default account view and controller are in my project but I haven't done anything with them yet) and I can view all my other pages just fine.
Update: I FINALLY figured it out. The image file in question was encrypted. Right click the image file and navigate to properties, click the advanced button on the general tab, uncheck "Encrypt contents to secure data", click OK, OK.
The tip off finally came when I noticed the file name was green in Windows Explorer. I see green file names all the time with no problems so I didn't think anything of it. Then I noticed it was the only green file in the entire web app folder. Put two and two together and it worked instantly. Thanks everyone for your help.
Please Add two users
IUSR,
IIS_IUSRS
to the publish folder and assign permission for them to read & execute
I FINALLY figured it out. The image file in question was encrypted. Right click the image file -> properties -> advanced button on general tab -> uncheck "Encrypt contents to secure data" -> OK -> OK.
The tip off finally came when I noticed the file name was green in windows explorer. I see green file names all the time with no problems so I didn't think anything of it. Then I noticed it was the only green file in the entire web app folder. Put 2 and 2 together and it worked instantly. Thanks everyone for your help.
Is it possible that IIS 7.5 was not installed correctly?
If you go to Turn Windows Features on or off - under:
Internet Information Services /
World Wide Web Services /
Common Http Features
there is a Static Content checkbox
is it checked?
see this link for screen-shot.
in css set "display: block"
.searchbtn
{
margin-top:-15px;
background-image:url(../images/icons/search.png);
background-repeat:no-repeat;
width:18px;
height:18px;
display: block;
}
The URL should be relative!
background-image: url(images/bsb_header2.png)
From your description, it appears as if the Request for the .png is getting routed to the ASP.NET/MVC engine instead of being served up by IIS.
Is it possible that the routing rules in the Global.asax are picking .png files? (I know this doesn't explain why it works in your dev environment).
Does it work if you add a ignoreRoute for .png files at the beginning of your route list in Global.asax? Something like below...
routes.IgnoreRoute("{resource}.png");
Had the same issue and finally found a solution.
In IIS open "Authorization Rules".
If there is nothing there, click "Add Allow Rule"
Choose "All Users" and hit OK

Change default browser by project or solution in Visual Studio 2008?

i have to work on various web projects for different customers. some use IE only, some Firefox and other browsers in their companys.
i would like to debug project/solution A with IE and project/solution B with firefox (and so on) by just hitting F5 or "view in browser".
I do NOT want to switch the default browser in visual studio via:
right click on an .aspx file in the solution explorer
browse with...
selecting the browser i want to use
pressing "set as default" to make it remember my choise (optional)
everytime i have to work on another project/solution.
Can i save the default browser by solution or project and NOT via VS global settings somehow?
do you have any hint for me how to archive this? is there maybe even an addin for this?
thanks, toebens
In the project properties, in the Web section you can have it start an external application with parameters at the start of debug (F5) so you could specify the path of the browser as the Start External program path and the http://servername:port/virtualdirectory as the command line argument
alt text http://img142.imageshack.us/img142/3708/projectprops.gif

Resources