Section styles in asp.net webpages - asp.net

I have the code below to add the scripts to a content page controlled by a layout page, it works. However i'm looking to do the same for css styles. I've searched, but to no avail. What I got was the "#section style" syntax which didn't work. I've seen it in mvc, but i'm not sure if it works in webpages. Can someone please let me know how this could be archived...if possible. Thanks in advance!
#section Scripts {
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
}

Related

Include Angular file in layout.cshtml

I want to include my angular file(Layout.js) inside my _Layout.cshtml.
So I added it at the end of the page like this:-
#section Scripts{
<script src="~/Angular_Files/Layout.js"></script>
}
This does work but only for the index page. Whenever I click on another link say course.cshtml, my angular file(Layout.js) doesn't get included.
PS: I tried to explain the best I can. Feel free if you need any more clarification.

2sxc: Adding more content templates in the same page does replicate link tags for css and js

I'm new to dnn and 2sxc.
Just wondering if I'm adding for example a card template (image,some text, a link), adding in the html template link tag to css/js, when adding that content more times in the page obviously the link tags are replicate in page source and it isn't so nice.
For example:
<script src="[App:Path]/script.js" type="text/javascript" data-enableoptimizations="100"></script>
it is going to be replicate in page.
Maybe I'm missing something, there is a better way to do it?
Thanks you :)
If you tried it, you should see that it will only be included once, IF you have the data-enableoptimizations included :)
So allready taken care of
Maybe i found the issue...
When I edit a template, selecting Html snippets in the combo to the right, then click on css, style-sheet it is writing a demo link tag, but it is not adding the type (type="text/css"), without it seems not work..
Maybe it could be fixed in a next release :)

How to add code area css style to HTML

I am trying to create a blog in wordpress. Since I might need to add some code blocks to my posts, I was wondering if there is any CSS style to represent code block.
A very simple example would be stackoverflow code tag (shown below)
<script type="text/javascript">
alert('this is example of what i need to do ') ;
</script>
Since you are using wordpress, there are plugins to do that. Just by looking at http://wordpress.org/extend/plugins/tags/syntax-highlighting there seems to be quite a few to choose from.

Show Loading Bar or animated GIF while CSS and JS files are loading?

I've seen this question asked in pieces (just JS or just CSS) on other sites and SO, but I haven't seen a good solid way to do this yet.
My situation is fairly common. I'm using .NET MVC and developing in Visual Studio. I have a Site.Master page and multiple views, each with a content placeholder where I specify my JS and CSS files, like this:
<asp:Content ID="headerContent" ContentPlaceHolderID="HeaderContent" runat="server">
<link href="../../CSS/example.css" rel="stylesheet" type="text/css" />
<script src="../../JS/jquery/jQueryFile.js" type="text/javascript"></script>
<!-- More files here -->
</asp:Content>
And my navigation bar is a sprite image, similar to the one seen on Apple's website. I have site sections with headers, also similar to Apple's, that are images. So my site isn't extremely image-heavy, but especially when I view in IE (but also Firefox, to some extent), the site sort of pieces itself together before my eyes, while it loads the images and jQuery files for plugins (datatables plugin always takes a second to apply to my tables).
I'd rather not show the page at all until all images, CSS, and JS files have loaded. A nice progress bar, or even an animated GIF would suffice to show before I show them the final site, all loaded. I think Gmail's loading bar uses this same idea.
Are there any suggestions on how best to achieve this? Thanks very much.
Try this: http://bytes.com/topic/javascript/answers/512734-how-make-progress-bar-while-browser-loading-page
I've not tried this out yet, give it a cautious try. Inside $(document).ready, create an overlay that displays a loading icon, like an animated circle sorta thing. I'll assume you'll name it #overlay.
Then, outside of $(document).ready, try this
$(window).load(function(){
$("#overlay").hide();
});
$(window).load means everything is ready: http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/

CSS navigation?

The navigation on the left menu in the below site uses CSS for mouseover links.PVH
When I take the code of the navigation and make it separate page. Then the mouseover links are not working. What could be the reason?
Test
Probably...
<script src="menu_1b.js" type="text/javascript">
</script>
<script src="menu_com.js" type="text/javascript">
have something to say on the matter. EDIT: A function called function CreateMenuStructureAgain() kind of gives it away.
You need to "borrow" the scripts found at
http://www.pvh.com/menu_1b.js
http://www.pvh.com/menu_com.js
and then link to them using
<script src="menu_1b.js" type="text/javascript"></script>
<script src="menu_com.js" type="text/javascript"></script>
You could probably try
<script src="http://www.pvh.com/menu_1b.js" type="text/javascript"></script>
<script src="http://www.pvh.com/menu_com.js" type="text/javascript"></script>
and it will work (provided that you have an internet connection, and they don't modify the scripts :D)
As mentioned, you needed to take the scripts too. I was going to take a look at a solution for you but then I opened the JS code you were attempting to use. You could do a lot better with a lot less code. Try looking at this menu example and the accompanying code. You should be able to do exactly what you need without the need for vast amounts of Javascript.

Resources