Make IIS To Deliver Stylesheets With Correct MIME Type?
Jan 11, 2010Currently my IIS is serving CSS files with no Content-Type header. How to change it? Should I change it on my application or in the server?
View 1 RepliesCurrently my IIS is serving CSS files with no Content-Type header. How to change it? Should I change it on my application or in the server?
View 1 RepliesI am not sure if I have found the right forum for this one.
the problem is:
I have a .licx file in my rootfolder.
I am getting the error:
Error 53 Unable to resolve type ' <add type="TabStrip" version="7.0" />' C:inetpubwwwrootCrop_ApplicationCrop_Applicationeo_web.licx 7 Crop_Application
,which I get for all the types that are in the xml file(i just gave one of them).
A friend told me that I have to add the type .licx in the MIME type in the IIS .
The problem is that I find the MIME type, I add the extension type .licx but I do not know the MIME type for .licx
I need to get the mime types in an IIS7 environment. They should be in:
<configuration>
<system.webServer>
<staticContent>
<mimeMap...
As I understand it, in IIS7 if I can get to it I should see both custom additions in my web.config as well as the mime types defined in the IIS manager at the machine level.
I don't understand how to get to this data. I have messed with the configurationmanager but I am not getting anywhere. I can get a section names system.webServer but I don't see any of the actual data as colleciton of properties or as xml.
When inserting a binary file do you know what will be the correct content type for extensions like .txt or .gif or others not in your sample? Is there a list of correct content types?
View 1 RepliesThere is any difference between application/x-javascript and application/javascript mime type?
View 3 RepliesI have a simple upload page using the html file element. I choose a .pdf file to upload and when I inspect the Content type of the file when it goes to server the value is "application/msword" instead of "application/pdf"
View 1 RepliesI've recently inherited an ASP.NET 2.0 project from other developers and they have a LinqToSql datacontext with stored procedures. I've been asked to modify one of the SPs which is essentially just adding a couple columns to the database table and then those to parameters to the SP. So I delete the existing SP from the L2S context and drag in the new one with the additional fields, and all hell breaks loose. Suddenly I get over 20 errors! What seems to have occured is L2S has modified many other stored procedures that I haven't even touched and changed the return type from ISingleDefault<some object> to int. I've never used stored procedures before with L2S so I don't know if this is standard behavior or not. Does anyone know why this has happened and how to fix it to set the correct return type?
View 3 RepliesI new to .aspx and now the thing is since i am doing a web enabled project, I have this login from an user. I drag dropped the login template and then used the
Session["Authentication"] = username.Tostring();
to store the current logged user's info and so. Now i even used a hyperlink "Logout" at the top right corner and then made it transfer to Login page.
Now if on running the web , i can easily login , but when i logout through hyper link "logout" it will take me to the Login page again, but if i press the back button of the browser it again transfers the control to the data page and i can again perform the data operation's.
I used this
Session["Authenticate"] = null
at the page load of the login page so that only at the login button click the user can enter again by
Session["Authenticate"] = username.Tostring();
Then i used a check at each page load of the data pages
if(Session[Authentiacte"] == null)
Server.Tranfer("LoginPage.aspx");
In my VB.Net code I am using boolean type and it is later stored through a stored procedure to a MS SQL database table. I have so far allways been using "int" as the column type in database table because there is no Boolean type to choose from when designing the columns of a table in the MS SQL Express? Is it correct to use the column type int for storing Boolean values?
View 2 RepliesI have this particular problem all over my current code, but I not sure the way to correctly deal with it. All I am trying to do is set the function as a structure and return the structure depending on the values.I can see why this is not setting the structure values in all cases. This works as well if I remove the return part of the function, but then I get a different error.If I add a line at the top setting the getVirtualURls to nothing then it works, BUT .. I am not sure of the correct way to deal with this example. I mean in performance and also in clean code.example would be great :-)
[Code]....
My end goal is to open up a new browser window and display an animated progress gif whilst loading a slow Crystal Report.Using traditional asp.net methods to achieve this always results in the gif not animating during a postback,unless I use update panels but that's when things start getting messy.
I have read lots of articles describing how you can publish a Crystal Report as a web service using Visual Studio .net.This always relies on using the web service as the report source and binding a ReportViewer object to the data source/service.
I would like to do something a little different but I'm not sure its possible. I would like to build a asmx Service that returns the report just as HTML once its built.If this is possible,it will allow the loading of the report using Javascript AJAX methods.This would enable me to display a nice animated gif whilst the (sometimes slow) report is constructed.
I'm not sure how the report will behave though if generated in this way,would the stock navigation and export buttons still work?
Im looking to improve performance on my site and would like to implement OutputCaching for a number of actions on my controllers. The main problem is when administrators navigate to an action with an output cache specified I need to ignore the cached content and execute the action.
Is there a way I can configure the OutputCahing mechanism to not deliver cached content for specific users if they are authenticated and a member of a specific role?
I have a VS 2008 asp.net application which runs perfectly under the Visual Studio environment. I have deployed the application to my local IIS (IIS 7 on 64 bit Windows 7 on the same PC as my VS 2008). When I then try and connect to the default.aspx page, I get the basic page but no stylesheet or gifs appear to be downloaded. I have run the app using Live HTTP headers and get code OK 200 saying that the resources have been retrieved but they are clearly missing. I have my stylesheets and GIFs in 2 subfolders of the root folder ( ie is rootmyappCSS and rootmyAPPResources ).
I have changed the pathing etc (using ../ and ~/ notattions and still cannot get the stylesheets/GIFs to appear on my default.aspx page). The web logs do not show any errors. Does anyone know anything else I can try? Or point me to the next step in resolving this problem?
I want to add StyleSheets programmatically in the head section but one of the examples I saw seemed to need to many lines of code to add just one style sheet even though I may need a lot: Example Code:
HtmlLink css = new HtmlLink();
css.Href = "css/fancyforms.css";
css.Attributes["rel"] = "stylesheet";
css.Attributes["type"] = "text/css";
css.Attributes["media"] = "all";
Page.Header.Controls.Add(css);
I also use Page.Header.RenderControl() method but it didn't work either. Object null something error was thrown. I also used Page.Header.InnerHtml and InnerText += "<link .... "/> things but they threw the Literal error which is I think common error. I used this code :
List<Literal> cssFiles = new List<Literal>();
cssFiles.Add(new Literal() { Text = @"<link href=""" + ResolveUrl("~/Resources/Styles/MainMaster/MainDesign.css") + @""" type=""text/css"" rel=""stylesheet"" />" });
cssFiles.Add(new Literal() { Text = @"<link href=""" + ResolveUrl("~/Resources/Styles/MainMaster/MainLayout.css") + @""" type=""text/css"" rel=""stylesheet"" />" });
AddStyleRange(cssFiles);
private void AddStyleRange(List<Literal> cssFiles)
{
foreach (Literal item in cssFiles)
{
this.Header.Controls.Add(item);
}
}
It worked at first but when I change the pages it stopped working. I am using Master Page and I am writing these codes on Master.cs file and also some people recommended to use this.Header instead of Page.Header but when I built it throws an error which says I cannot declare that like this. It shouldn't be that hard to add many styles.
Embedding RadEditor in my page but Master page's CSS is screwing it up ..like Editor's content area is inheriting background-image property of the body tag when I want it to be white..drop down lists inside of Editor too are not displaying correctly..I don't wanna create whole new custom skin
View 1 RepliesWhen developing large application using ASP.NET (MVC or classic, doesn't matter), especially in large team, it is easy to produce a lot of messy, non-traceable CSS definitions. After some time we can end up not knowing why particular definition exists and what is its real effect considering style inheritance and cross-browser differences. Needless to say, changing anything in that mess is a risk and there are hundreds of ways how small change could affect the system.
I know some solutions to organize CSS stylesheets better, like predefined CSS "frameworks" or DotLessCss engine, but I still find it quite hard to cope with CSS as there is no such relationship between HTML markup and CSS styles like i.e. between interface and concrete class in C# code. I know this is by design to make presentation separate from the structure, but I believe it might be useful to have such a correspondence at development level.
Ideally, I need something that can enforce the team not to make messy CSS or be able to clean that mess up automatically. Do you know any resources that may help me, or any guidance how to manage my CSS definitions easily? Let me ask for something a bit different:Despite of my several years of web experience, I believe I would feel much more confident if some of my CSS could be moved into C# code, the same way as some of HTML generation is done by MVC HTML Helpers. It saves me writing a lot of unnecessary markup, still allowing to do so if needed. And it is more unit testable, easier to refactor using tools like ReSharper etc. I don't need mergers and compressors of my CSS, I would like to be able to manage my CSS at declaration level. Maybe there are some tools like that I'm not aware of, or maybe that idea is just wrong and wouldn't be useful?
I think I summed up the question in the title. Here is some further elaboration...I have a web user control that is used in multiple places, sometimes more than once on a given page.The web user control has a specific set of JavaScript functions (mostly jQuery code) that are containted within *.js files and automatically inserted into page headers.However, when I want to use the control more than once on a page, the *.js files are included 'n' number of times and, rightly so, the browser gets confused as to which control it's meant to be executing which function on.What do I need to do in order to resolve this problem? I've been staring at this all day and I'm at a loss.
View 2 Replieswhat document type & HTML should be used in .Net page to make it W3C compatible so that it can pass the W3C validator check ???Can single CMS (.Net) can be used for multiple domain names ???How can we do without sub domain ???
View 2 RepliesThe project I'm working on allows an end-user to modify CSS code to integrate the application as best possible. Most of the CSS values are stored in a database and need to be retrieved and parsed dynamically. I setup a Style controller, and gave each stylesheet an action, and then passed the configuration data through to the View. I set the ContentType to "text/css" and then generated the stylesheets. This works fine, but the problem I'm running into is this: none of the code works in the application. I include it in the head code, but it doesn't parse in the code. An example of what I do is this:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" ContentType="text/css" %>
.element {
background-color: <%= ViewData.Model.BackgroundColor %>;
}
I include it like so:
<link href="/style/Basic" rel="stylesheet" type="text/css" media="all" />
When I include the CSS code in a partial view and include it using the ViewModel (wrapped in style tags) in an action, then everything works fine. It is when I try to parse this as a separate file when it does not work. Is there something I am doing incorrectly? Or is there some kind of glitch?
I want to display an editor for a type User. User contains a field Address of type Address. I made an editor template for the type Address so that it is reusable.
I don't want the field Address to be required for creating a user. But some fields are required for Address, for example country, state etc.
I want to validate Address if I receive any data for it, if I don't receive anything, then I don't want to return any validation error to the UI for Address. I would return only validation errors for User then.
I'm trying to let the user download different documents where the data is stored in an SQL DB. In firefox, the filetype is correctly read, but not in IE. I'm trying to do this without having to set the ".pdf" or whatever extension the document has, because I haven't got that information. I only have the filetype.
[Code]....
Ive got an ASP:Menu in my page and want to display a background image for each item, and have that background change when the user hovers over, or selects it.
However, the UnselectedTab style applies when the page loads but then the style doesnt change on either select or hover, ...
Code in my asp.net page...
[code]...
I created a script for Internet Explorer which can be installed using GM4IE (Greasemonkey for Internet Explorer) and it has the extension .gm4ie.
When I try to give the download link to this file on my server, it gives this error:
http://i.imgur.com/K7Rs4.jpg
page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
How do I add this this hanlder or a mime map and where do I add this?
On a controller action I am returning a file do display:
[Code]....
I am doing a workshop , it has questions, and answers with radiobuttons, I need that when a click is made on a radiobutton a message appears saying that it is correct or it is not correct, how can a do it,
View 10 Replies