Javascript - Combining Conditions Included Script Files?
Feb 1, 2010
We are working on an ASP.NET CMS project using jQuery as the basis for our client side scripting. The jquery-1.2.6.js file is the only script file that is always included. Other script files are currently included depending on what components the CMS editor is using on a page or page template.A lot of the script combiners produce a static script. If we took that approach we would have to add all possible script files in just in case they were needed. We are not currently using any of the ASP.NET Ajax extensions so have not looked at what that may give us.
View 2 Replies
Similar Messages:
Apr 14, 2010
For the sake of client-side performance, it's best to minimize the number HTTP requests to load a page. Is it possible to combine the contents of all Javascript files stored in the "Style Library" such that the client only has to make one request instead traditionally, a request for each Javascript file?
View 1 Replies
Mar 17, 2011
I have a Asp.Net Web Application that uses Themes. Inside the theme directory are 9 *.css files.
I've published the Web Application months ago on a IIS 7.5 (and updated regularry). If I browse the site from my computer, my private computer or some virtual machines at a hosting facility, the site will be perfectly rendered.
However, some employees of the company we created the page for are recently having display issues. I was just able to reproduce the issue via remote session and found out, that only 8 of the 9 styles in the selected Theme directory are included into the page. (IE developer toolbar showed the this)
The client is using Internet Explorer in version 8.
The problem does not only seem to affect employees of the same company rather than visitors from outside as well.The name of the stylesheet, that sometimes not included into the page is called style.css.
I've checked if the file was not accessible from the computer I created the remote session with, but that was not the case. The style.css was browsable. For now I'd try to move the style.css out of the App_Themes directory and include it manually via the MasterPage.
Update: I also discovered that some
<asp:Images ImageURl="~/images/mypic.png">
are also not being shown, just the red X for image not found. Maybe that's related? I looked for the Internet Explorer setting multimedia -> show images, it was checked. I'll try to replace the pngs with jpgs for now.
View 1 Replies
Nov 2, 2010
I would like to implement the application where user can include the different CSS files when clicked on different buttons. how this can be achieved. I don't want to use the theme feature.
I am trying to change the CSS but I have noticed the ungly behaviour as follows:
When using mozilla i see the source code for page i see code for latest CSS. But its not getting downloaded/ tried using the tamper data request to download CSS is not getting sent. When I inspect the elements style is still the old file
View 3 Replies
Mar 25, 2010
combining these type of files so that there are fewer http requests? Or for that matter any other tips on making them more efficient?
View 5 Replies
Feb 17, 2011
So the problem is the following :
i do have own user control. which has some javascript file in script tag included like this
<script type="text/javascript" src="../somefile.js" ></script>
or some javascript code directly on the ascx page. everything works if i place this control somewhere in aspx markup. but if i add this control to the page dynamically to some UpdatePanel place holder on postback (this is logic i can not alter), control renders itself and then i get js error message, which says that functions which are placed in somefile.js are not defined/are null. Why is this happening ? Is there anyway to force js including in this case.
the code amount is huge and i was not able to provide a simplified example with the same error,.
The script is included but somehow the functions are not defined. I'm novice to js, so is it possible that just the script is included but not executed, so the functions are not declared ???
The interesting is that if on some page my custom control is declared in aspx.
View 3 Replies
Jul 27, 2010
I am using mixed validation i.e. dot net controls validation and javascript validation. Javascript(js) function is 'hpVali()'. It is working when coding javascript within aspx page's head section. but when i moved it in a js file. It stoped working.
I have used the script to register/add js file in aspx.cs file as:
[Code]....
View 6 Replies
Jan 20, 2010
I'm building several user controls (ASCX) for my website and several of them are very similar in what they do. (As a side note, I must create unique UC's even if they're similar because I'm creating widgets for the new Telligent Community themeing system). For example, two of them are different but use the same front-end code to create a 2 or 3 tab panel where you can click a tab and it changes the data below. I have a single JS file to handle these tabs and the animations. I'm currently dynamically adding my JS file reference to the <head> from the user controls' code via:
Literal jsFile = new Literal();
jsFile.Text = string.Format("<script src="{0}"></script>", "/community/themes/test/js/tabbedCallout.js");
Page.Header.Controls.Add(jsFile);
If I have both of these controls on a page though, both will add this JS file reference. How can I do a check to see if it is already added from another control?
View 1 Replies
Mar 26, 2016
i have made an .aspx page of c# in folder named as "USERPANEL". Also placed all my js in "js" folder and css files in "css" folder & all these pages are placed under "USERPANEL" folder same location where i have create a page. If i would placing the css on the page itself then it's working but not loading any external stylesheets. why? below is code as i am attaching the fontawesome file placed in fonts folder.
<link rel="stylesheet" type="text/css" href= "fonts/font-awesome.css" runat="server"/>.
View 1 Replies
Mar 2, 2010
I use the code bellow to dynamically include a CSS file:
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink link = new HtmlLink();
link.Attributes.Add("href", Page.ResolveClientUrl("~/App_Themes/Default/StyleSheet.css"));
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
head.Controls.Add(link);
The problem is: I want to do it only once, and only if it isn't alrealy included in the page.
How do I verify if it is already included?
Edit:
Answers telling me to include in page load using !IsPostBack won't solve my problem, as this code will be inside a Web User Control and my page may have a lot of the same user control.
For example, I use the code below to do it with javascript:
if (!Page.ClientScript.IsClientScriptIncludeRegistered("jsScript"))
{
Page.ClientScript.RegisterClientScriptInclude("jsScript", ResolveUrl("~/Utilities/myScript.js"));
}
View 3 Replies
Jan 15, 2010
I am working on my company's website and when I get the project from the Source safe and compile it. It compiles and run's fine.
But how come the Bin folder is not included in the project and how come my application is still running fine.?
Don't the BIN folder needs to be included my doing the right click on the BIN folder and including it in the project.?
View 2 Replies
Aug 20, 2010
[Code]....
This code works!But Iwonder whether the same code can be included in additionaltbl_PaymentDetails tbl_PaymentDetails creditcardnumber = new ()?This is not works!
[Code]....
View 2 Replies
Oct 31, 2010
I have upload control on my asp.net page. I upload pictures in folder cars and they show in windows explorer when I open that folder (cars), but in Visual Sudio they act like they not include in project ( that is the reason why they don't show on image control which point to some of them. What did I make wrong ?
View 3 Replies
Mar 4, 2010
When we reference a DLL. It creates that DLL in the BIN folder of our project.My question is although the BIN folders are not included in the web application project thenhow come all the code works? When I right click on the Bin folder I get an option "Include in Project"So how come I am able to use all the methods inside the dll's in the BIN folder even though the BIN folder itself is not included in the Project? Do we ever include the BIN folders?
View 10 Replies
Jun 10, 2010
I have an IIS web site. This web site contains other web sites so the structure is like this.
[code]....
The problem is that it now tries to find the file at http:serverMainWebSiteScripts....
How can I work around that? Should I put all my scripts and CSS files into the root directory, is that a preferred solution?
View 3 Replies
Aug 6, 2010
I've been working on this for a while and was wondering if anyone has run into the issue of error 404 on IIS. More specifically, when I type in http://localhost/test/test.aspx, the page runs, but the referenced files (JS and CSS) are not being used.
View 3 Replies
Jan 14, 2010
I am developing a website in ASP.NET and I am using various javascript frameworks/libraries. The different files belonging to these frameworks/libraries rarely changes thus there is no reason to refresh those files once they have been sent to the client browser (atleast not everytime a page is served).I see that the HttpContext object can be used somehow, that I can set the content expiration on the files/folders on the IIS, or maybe setup somekind of caching in the web.config file. 1. What is best practice/what approach should I take
View 2 Replies
Feb 23, 2010
Is it possible to merge several JavaScript files being used on a site into one? I'm looking to do this to minimize server loads by forcing only one download. This way I can keep my JavaScript organized into separate files and still have efficiency.
View 2 Replies
Jul 6, 2010
I have a site under construction which has a control panel for login/logout and it is in an include file on every page.
We currently have a "login page" which functions just fine but I want to take that and incorporate it into the control panel so the user could log in from any page.
Problem is that the .NET programmer wrote all of the login logic using code behind only on one single page.
Is there some way for me to work around this or to incorporate this vb code into every page so that the cpanel can function as it should?
View 1 Replies
May 3, 2010
I have an editor in which user enters the data from any other website. The issue is while pasting such data, the css of that website is also included which disturbs my page. When the entire data is displayed I don't have any problem whereas when I trim the data such as first 100 characters alone are displayed then the content overlaps my style and gets exceeded from the alignment.
View 2 Replies
Jul 10, 2010
I have two List's that contain a object of Tag like List<Tag> i need to find excluded and included to do an update operation how do find the difference in them both since they contain a Tag object. Can you use Contains function with a Tag object inside the list.
[Code]....
View 3 Replies
Apr 28, 2010
I wondered if anyone knew how to utilize the asp:Menu control with <H2> around the Item Headers. If so, how were you able to implement it?
<asp:Menu ID="mnuMain" runat="server" ForeColor="White" StaticDisplayLevels="2" Font-Bold="False" ToolTip="Main Menu" SkipLinkText="" MaximumDynamicDisplayLevels="1">
<DynamicMenuStyle BorderStyle="Dotted" />
<DynamicMenuItemStyle ForeColor="Black" />
<Items>
[code]....
View 2 Replies
Mar 18, 2010
I have heard that if we use gzip, aspx files will be loading faster. But, I am not sure as to how to use it in my web applications. I am hosting my site with GODADDY (ASP 2, IIS 7) Can anyone tell me if I will be able to use gzip? Can you give me a sample file where gzip is used?
View 4 Replies
Feb 2, 2011
I am developing in asp.net mvc and using multiple javascript files.eg jquery, jquery-ui, google-maps my own js files etc.for performance should i combine these into one?if so how?
View 4 Replies
Sep 28, 2010
I recently ran yslow on a page i have (master paged etc) and it returned that there were far too many javascript files included (most of which I haven't added).
I guess my question is that given i have v1.0.20229.0 of the toolkit.dll (over .net 2)
I'm wondering if subsequent releases have fixes for this sort of thing?
View 2 Replies