asp.net css issue after deployment - asp.net

I am experiencing a very strange issue. I have developped an application locally and everything works file. But on the production server i have several problems. The most annoying is the Navigation Menu that changes from horizontal to vertical after login.
site.Master
<asp:Menu ID="NavigationMenu"
runat="server"
cssclass="menu"
EnableViewState="false"
IncludeStyleBlock="false"
Orientation="Horizontal"
StaticDisplayLevels="1"
staticsubmenuindent="10"
target="_blank"
MaximumDynamicDisplayLevels="1"
Enabled="False"
Visible="False">
Site.css
/* TAB MENU
----------------------------------------------------------*/
div.hideSkiplink
{
background-color:#3a4f63;
width:20%;
z-index:9999;
}
div.menu
{
padding: 4px 0px 4px 8px;
z-index:9999;
}
div.menu ul
{
list-style: none;
margin: 0px;
padding: 0px;
width: 20%;
z-index:9999;
}
div.menu ul li a, div.menu ul li a:visited
{
background-color: #465c71;
border: 1px #4e667d solid;
color: #dde4ec;
display: block;
line-height: 1.35em;
padding: 4px 20px;
text-decoration: none;
white-space: nowrap;
z-index:9999;
}
div.menu ul li a:hover
{
background-color: #bfcbd6;
color: #465c71;
text-decoration: none;
z-index:9999;
}
div.menu ul li a:active
{
background-color: #465c71;
color: #cfdbe6;
text-decoration: none;
z-index:9999;
}
The css i use is the default.
I searched the net but no solution is proposed. Is it a server issue?Is it my code?
There is this thread with the exact problem. http://forums.asp.net/t/1762140.aspx/1?Odd+menu+problem+after+deployment , which doesnt propose a solution for the problem
Thanks

In all likelihood, the javascript which adds the class is not running on the page
There could be a number of reasons
It wasn't deployed properly.
The path is incorrect on the live server (are you in a different directory layout - eg /JavaScript/ instead of /myapp/JavaScript/?
NoScript or another addon is blocking javascript (browser-specific)
Something in the JS breaks on live and prevents execution before it gets to the relevant code
To track the problem down - Go to the net tab in firefbug and look at the javascript - does it all load with an HTTP 200 (Ok) ? Any 404/500s?
Try disabling all addons in your browser / use different browsers - same problem?
Open up the Script tab in firebug or the JavaScript console (CTRL Shift K in Firefox)
Reload your page and see if any errors/warnings appear.
Edit your answer with the results of the above and we'll see what we can do.
EDIT:
With regards to the 403/Forbidden - WebResource.axd is where the .Net Control-specific JS lives so this is almost certainly your problem. To make it more fun, .axd's aren't usually real files - they're HTTP handling extensions - see here and here for more information. Check your web.config - did the appropriate handlers get set in Live? It should be something like...
<add path="WebResource.axd"
verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader"
validate="True" />
If you've got an entry like that, can you edit your question to include it exactly? If not, try adding it
Possible fix here
Does the live server have the same version of the framework/controls installed as your development machine - Make sure it has!
Another thing to be aware of is that if you manually deploy a website, the files are usually owned by you, not the webserver - This can sometimes mean the webserver can't read the website to serve it. I doubt that's the problem here but it's something to be aware of in future. (To check, the website user is specified on the application pool for the site in IIS Manager).

Related

Superfish menu does flicker when moving mouse pointer along border

The superfish menu here does flicker when moving the mouse pointer along the border: http://www.kine-stammheim.ch/
The css file is here: http://www.kine-stammheim.ch/css/navigation/superfish.css
My guess was that the hover item would have a different size than the standard and this is why it would flicker. But I cannot find the issue...
Who can help?
The problem was being caused by the margin you had on the hover state.
This is what I changed
.sf-menu li {
margin: 0px;
padding: 5px; /* I added your 5px margin as padding to the li that contains the a. This gave the same effect without confusing the hover state */
list-style: none;
float:left;
background: #536bff;
}
.sf-menu a {
line-height: 35px; /* I removed 10px of line-height since the li now has a 5px padding */
padding: 0 15px;
color: #fff;
text-decoration: none;
letter-spacing: 1px;
display: block;
}
body#home a#homeNav,
body#ikmethode a#ikmethodeNav,
body#uebermich a#uebermichNav ,
body#contact a#contactNav,
body#anwendung a#anwendungNav,
.sf-menu > li > a:hover,
.sf-menu > li.current > a,
.sf-menu > li.sfHover > a {
background: #8398ff url(../../images/bg-top-a-active.png) no-repeat center bottom;
height: 35px;
line-height: 35px;
border-radius: 5px;
text-decoration: none;
}
Here is a working JSFIDDLE to show you the end result.
Have you tried hoverIntent plugin?
Supports the hoverIntent plugin.
Superfish automatically detects the
presence of Brian Cherne’s hoverIntent plugin and uses its advanced
hover behaviour for the mouseovers (mouseout delays are handled by
Superfish regardless of the presence of hoverIntent). Using this is
only an option, but a nice one. The examples on this page are using
hoverIntent. If for some reason you want to use hoverIntent on your
page for other plugins but do not want Superfish to use it you can set
the option disableHI to true. Important note: As of v1.5.1 you must
use the updated version (r7) of hoverIntent which supports event
delegation.
hoverIntent is a plug-in that attempts to determine the user's
intent... like a crystal ball, only with mouse movement! It is similar
to jQuery's hover method. However, instead of calling the handlerIn
function immediately, hoverIntent waits until the user's mouse slows
down enough before making the call.
Why? To delay or prevent the accidental firing of animations or ajax
calls. Simple timeouts work for small areas, but if your target area
is large it may execute regardless of intent. That's where hoverIntent
comes in...

ASP Menu rendering outside of it's container div

I'm preparing to demo my client's system, but all my work thus far has been on my development and test environments and has all gone very smoothly. Setting the system up on a new environment for the demo has - for some reason I can't explain - wrecked the menu.
Basically the menu in the demo environment, while using the exact same code as the other, the menu doesn't render inside of it's container. Screenshots and code to follow:
How it should look
How it does look
I originally wrote the system in Visual Studio 2012, but due to unforeseen limitations with a demo, I had to "port" it all back to 2010. Basically this just involved some copy/paste of the event handlers and such into new files.
Here's the code:
<div class="menu">
<asp:Menu runat="server" ID="mnuLoggedIn" Orientation="Horizontal" RenderingMode="List">
<Items>
<asp:MenuItem Text="Manage Complexes" NavigateUrl="~/Members/Complex.aspx" ToolTip="View, add, edit or delete complexes"></asp:MenuItem>
<asp:MenuItem Text="Manage Units" NavigateUrl="Units.aspx" ToolTip="View, add, edit or delete units"></asp:MenuItem>
<asp:MenuItem Text="Manage Subcontractors" NavigateUrl="Subcontractors.aspx" ToolTip="View, add, edit or delete subcontractors"></asp:MenuItem>
<asp:MenuItem Text="Manage Insurers" NavigateUrl="Insurers.aspx" ToolTip="View, add, edit or delete insurers"></asp:MenuItem>
<asp:MenuItem Text="Manage Insurance Policies" NavigateUrl="Policies.aspx" ToolTip="View, add, edit or delete insurance policies"></asp:MenuItem>
<asp:MenuItem Text="Manage Jobs" NavigateUrl="Jobs.aspx" ToolTip="View, add, edit or delete jobs"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
And the css...
/* MENU
============================================ */
.menu
{
display: block;
height: 30px;
clear: both;
border-radius: 5px 5px 0 0;
background: #121211;
}
.menu ul li a
{
margin-left: 20px;
color: #fff;
line-height: 30px;
}
.menu ul li a:hover
{
color: #85bf25;
border: 0;
}
I feel like maybe I'm relying too much on the asp to handle the menu layout.
I wish I could provide a link to a working test case online, but no hosting that I have access to has support for asp.net. What I have done is to zip up the master page where this menu is, it's content page (which is as yet empty) and the stylesheet for your attention:
http://www.loganyoung.za.net/code/asp-menu-rendering-outside-of-its-container-div.zip
I've run through this with a fine-toothed comb and I just can't figure out what's causing the menu to appear outside of it's container.
Any assistance will be greatly appreciated. Thanks in advance!
Still don't know why this happened, but setting a negative top margin put the menu exactly where I needed it:
.menu
{
display: block;
height: 30px;
clear: both;
border-radius: 5px 5px 0 0;
background: #121211;
}
.menu ul li a
{
margin-top: -20px;
margin-left: 20px;
color: #fff;
line-height: 30px;
}
.menu ul li a:hover
{
color: #85bf25;
border: 0;
}

Hover over image won't appear when site is live

So when working with this site locally on my computer the hover over image works perfect. However, when I put the site up on a server then the image doesn't appear.
I'm referring to the links with the grey background image. I've provided the css specifically for the Contact us link.
http://bankruptcyimmigrationlaw.com/NEWSTARTLAW/Home.html
...
#Contact_us li:first-child a {
padding:9px 5px 15px 30px;
margin-top:25px;
background-image:url(../images/DefaultNavBg.png);
background-position:-30px -15px;
background-repeat:no-repeat;
height:76px;
width:350px;
border-bottom:none;
text-decoration:none;
}
#Contact_us li:first-child a:hover {
padding:9px 5px 0px 15px;
margin-top:25px;
background-image:url(../images/CurrentNavBg.png);
background-position:-30px -15px;
background-repeat:no-repeat;
height:76px;
width:350px;
border-bottom:none;
cursor:pointer;
text-decoration:none;
}
It appears that your images isn't where you think it is, I'm getting 404. It could be that you didn't upload it, or if your testing on Windows and deploying to *Nix it could be an issue with the case of the file (or directory) name.
You didn't send the image to the server:
http://bankruptcyimmigrationlaw.com/NEWSTARTLAW/images/CurrentNavBg.png
returns 404
Tip: Using webrowser with some king of inspector - for an example Chrome with build-in inspector or Firefox + Firebug is best friend of every webmaster, webdevloper, webdesigner, etc.
Edit
Try to avoid CaseMixing in all your file names and paths. This is very reason of mistakes and bugs, so using same variation of lower case is definitely better.
My favourite notation is_lower_case_underscored.jpg,
using hypens is other recommended way, however it can be reason of mistakes when creating filenames with JavaScript as the hypen can be recognized as minus operator by accident.

Changing style in the tabs of the plain ASP.NET project

I am trying to build a web app using as starting point the sample ASP.NET Web Application that VS2010 makes available in the Add Projects. Specifically, I am trying to use the tabbed menu, and change its behavior from the default. In particular, I am trying to change the tab colors. Well, this works in the designer. I can make the tab background white and the foreground red, but when I run the app it displays the tabs in the original drab colors. It is ignoring the changes I am making to the stylesheet, in other words. Or so it appears at least. Is there something I am missing here?
What I want is here:
This is what I get, despite my changes to stylesheet:
Here is the modified CSS element, which the designer is conforming to, but at run time is being ignored apparently:
div.menu ul li a, div.menu ul li a:visited
{
background-color: #ffffff;
border: 1px #4e667d solid;
color: #ff0000;
display: block;
line-height: 1.35em;
padding: 4px 20px;
text-decoration: none;
white-space: nowrap;
}
I am stumped.
Have you tried refreshing the browser/ clearing the cache?

webkit-browsers (initially) renders navigation in wrong place

Hi i'm pretty new to web development and have just recently finished my first attempt at web design. I've stumbled across one issue i can't find a solution to however. In webkit-browsers one of my ul-lists (navigation) initially renders in the wrong place. When i click on one of the links it pops back in the correct position again. Full site: stenius-online.com
header ul {
float: right;
padding-top: 16px;
font-size: 145%;
}
header li {
padding-right: 58px;
text-decoration: none;
}
On your site you have a link immediately preceding your <ul>. Make that link float:left; that should solve the problem.

Resources