question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to add my own CSS includes after "WebResource.axd"?

See original GitHub issue

The AJAX Control Toolkit 17.1.1.0

The installation method

  • Installer
  • NuGet package
  • A custom build from the source code

Minimal steps to reproduce

I want to be able to override styles from (e.g.) the Tab Control.

Since your RegisterCssReferences method seems to always append the “WebResource.axd” calls always to the very end of the HTML head tag, I can never include my own CSS files after that.

var link = new HtmlLink();
link.Href = href;
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
header.Controls.Add(link);

My question

Is it possible to add my own CSS reference below your “WebResource.axd” links inside the HTML head?

Browser(s) used

Google Chrome

A site deployment method

  • VS development web-server,
  • IIS

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
UweKeimcommented, Nov 23, 2017

That’s awesome, @MarinaRukavitsyna! DevExpress-quality support even here on GitHub.

Thanks a lot for your detailed help!

1reaction
MikhailTymchukDXcommented, Nov 23, 2017

Hi @UweKeim I checked the earliest available version of the toolkit and CSS rendering worked exactly as it works now.

You can render CSS as a bundle, so no links will be attached to the end of the head section.

  1. Install the AjaxControlToolkit.StaticResources NuGet package.
  2. Enable BundleTable optimizations:
public class Global : HttpApplication {
  void Application_Start(object sender, EventArgs e) {
    ...
    BundleTable.EnableOptimizations = true;
  }
}
  1. Render AJAX Control Toolkit styles bundle in the head section:
<head runat="server">
  <asp:PlaceHolder runat="server">
    <%: System.Web.Optimization.Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %>
  </asp:PlaceHolder>
</head>
  1. Place your custom CSS after this placeholder.

I have attached a sample project to illustrate this approach: СssTest.zip

Please inform us if this solution is suitable for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS from Telerik.Web.UI.WebResource.axd is overriding CSS ...
Hello, I'm having a problem with custom skins for most controls (only confirmed this with combobox and input so far) - the css...
Read more >
Where do the CSS styles from WebResource.axd come from?
Looking for an answer to your question - Where do the CSS styles from WebResource.axd come from?? Check the threads in Sitefinity -...
Read more >
Combine WebResource.axd CSS requests - asp.net
I'm using Telerik's RadScript manager which combines the javascript like a boss. However, I'm using the AjaxToolkit's ClientCssResource attribute to include the ...
Read more >
Using WebResource.axd for embedded resources
1. Add the image to your project. · 2. In the solution explorer, click the file, and in the property window, change build...
Read more >
Overriding the CSS from WebResource.axd - MSDN - Microsoft
The problem, is that I specified my own css stylesheet just before using my own <link href..> tag but the one coming from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found