Web Forms :: External CSS And JS Files Not Working?
May 7, 2015[URL]
I have used this article for routing its working fine but now js and css are not working ... i have used master page.
[URL]
I have used this article for routing its working fine but now js and css are not working ... i have used master page.
I have a problem with the connection of external files - northwind.MDF Connection to SQL Server is fine.
But to connect to external files wrong. Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Intance Specified)
I have a code like
var mySession = "<%= Session["MyID"] %>";
alert ( mySession );
and when I place this code in my aspx page inside a script tag, it works fine. But it doesn't work in an external js file. I am not able to figure out the problem.
Is there anything wrong in my code, or is it like this by default?
Our conn strs reside in an external file <connectionStrings onfigSource="ConfigurationConnectionStrings.config" />Is there a way to encrypt this external file either using aspnet_regiis or System.Configuration?
View 4 Repliesit's possible to load external CrystalReports (2008) .rpt files?
I now embed them so they're compiled with my core.
It would be nice if i can make changes to a reports layout without having to recompile anything. Is that possible?
By external config files, I mean .config files other than web.config. I've seen all the examples on how to edit web.config at runtime, but I want to edit a config file referenced by a configSource for appSettings. I want to modify only the external file and I will handle the app recycle.
I would like to use a built-in class to deal with the edits, but if the only option is a manual File open/parse, etc, then sobeit.
The general behind all this being a Settings page that is viewed at app startup, user sets their particulars and then saves the changes, then the real app starts up. quick and easy install app/configure page, so I'd like to leverage .config if at all possible.
FOLLOWUP - Quick Snippet to use XmlDocument to change an appSetting key value:
string path = Server.MapPath("~/my.config");
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlNode node = doc.SelectSingleNode("/appSettings/add[@key='myKey']");
node.Attributes[1].Value = "myVal";
XmlTextWriter writer = new XmlTextWriter(path, null);
writer.Formatting = Formatting.Indented;
doc.WriteTo(writer);
writer.Flush();
writer.Close();
I'm using visual studio 2010 professional. I have my javascript files in a subdirectory called javascripts where I am holding all those files respectively. I am constantly having to remove (from the head section) the external javascript link. Then rename the javascript file in the javascript's folder, then re-add the external file back to the head section again. The reason of having to do this is somethimes when I am editing the js file, and then go to test it, the aspx page doesnt seem to see the code anymore. I've tried different browsers, closing the window and reopening, deleting temp int files, but all to no success. Has anyone else had this happen, is there a better workaround??if i open the js file in the browser, the functions are showing properly.
View 2 RepliesI have a C# assembly that loads external files. This assembly is used by asp.net website. The following is the code that loads the data files
string dataDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),"data"); filePath = Path.Combine(dataDirectory,_fileName);
The component works fine in a windows app, but when I tried to use it in an asp.net website, it fails as the site could not find the data files. And it gives me the following error:
C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filescmictranslatorsite20a8eddd864b2575assemblydl35bd4a35e8c6f79b6_98eccb01datafile.txt
When we include Javascript files in our aspx files. either we write all the Javascript code in the Head section of aspx or we link to an external Javascript file.
So when the clinet makes a call to that page. Does that mean that all the Javascript will be loaded on the client side?
If that is the case then does not that mean that it will slow down the loading of page as all the Javascript has to be loaded on the client machine?
We need to find a .NET CMS system that does well in handling external data. Most of the data comes out of an external CRM system which is updated continuously. Some requirements:
We would like to avoid duplicating the CRM data. Meaning the CRM data should stay in the CRM system. Access to the CRM data can be handled via API, but raw db access is available as well of neccessary. It should be possible to edit the CRM data from the CMS UI, but all data needs to be saved back to the CMS db. News module Blog module Simple shop module for selling small number of t-shirts with different sizes/colors (optional) preferably MVC based (but knowing that this would limit the option too much)(optional) preferably c# based well supported, preferably with big community (was added to prevent custom solution ;) )
The focus of this question is which CMS system is good in handling external data, the other requirements are just to get an idea what kind of CMS we are after. **UPDATE** The data will be edited from CMS and CRM The user is supposed to work directly on the CRM database from both CRM and CMS system Concurrency issues are handled on DB level by optimistic concurrency. Basically an update might just fail, then the data gets reloaded and presented again to the user no data symmetrization of any kind should take place at any point
We are experiencing some strange behaviour on one of our ASP.NET web servers (Windows 2003 64-bit). After some activity, two third-party controls are unable to run correctly. One is log4net (it does not write error messages out) and the other is a menu control (it displays eval message instead of picking up its license). The one common thread is that both controls pick up their config from external config files (linked to from web.config).
Just wondering if anyone has any thoughts on this or experienced this in any way. Is it related to file/folder rights? The server has been running fine for a while and just started exhibiting this behaviour. Perhaps it occurs around the time the worker processes are recycled.
I have a site that needs the ability to upload image files. I copied this code from the Microsoft Website:
<%@ Page Language="C#" %>
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
try
{
FileUpload1.SaveAs("C:\Uploads\" +
FileUpload1.FileName);
Label1.Text = "File name: " +
FileUpload1.PostedFile.FileName + "<br>" +
FileUpload1.PostedFile.ContentLength + " kb<br>" +
"Content type: " +
FileUpload1.PostedFile.ContentType;
}
catch (Exception ex)
{
Label1.Text = "ERROR: " + ex.Message.ToString();
}
else
{
Label1.Text = "You have not specified a file.";
}
}
</script>..........................
i have a fileUpload in my web page but it's not supporting all files eg:
when i browse xls file it's working for small size files but when i go for a little bigger files let's say 50-60k it won't work and will give me an offline web page, i have tried the input HTML on server mode and still having the same problem.
I had used Custom error page in my asp.net application to redirect when I type a non-existing page while browsing that application.
I checked the list below
http://aspnetresources.com/articles/CustomErrorPages
by this I am able to redirect to Custom error page when I type a non-existing .aspx page.In the link it is explained to do one setting of adding .html extension link in IIS with "aspnet_isapi.dll" path. I did that setting even then the Custom error page for non-existing ".html" or ".htm" files is not working.
I am using the following code to upload multiple files:
// Upload Source Code -HANDLER upload.ashx
<%@ WebHandler Language="C#" Class="Upload" %>
using System.Collections.Generic;//using System.Linq;using System;
[Code].....
Iam using a file upload control for uploading files in my asp.net application. iam using the following code to impersonate the users who do not have permission for the files to upload. The code works fine for all the files, but it is not working for the files which are in desktop.
Code in .cs file:
System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
//Insert your code that runs under the security context of the authenticating user here.
impersonationContext.Undo();
In web.config iam using the following:
<identity impersonate="true" />
developing website with vs2010, asp.net4.0 , mvc2 jquery version 1.4.2. I want to upload files with ajax, but the jquery scripts don't working. my code:
view: <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="/Scripts/jquery-1.4.2-vsdoc.js" type="text/javascript"></script>
[code]...
now,the file could upload successully, but the view returned with refreshing,and only display ExamDetails.ascx on the page.
I uploaded some images and js files under aspnet_client folder of a domain account and it's giving me 403 - Forbidden: Access is denied.
The account is on Windows 2008 64bit machine with latest plesk installed,
I've confirmed read & execute permission is provisioned to Plesk IIS WP User, Plesk Domain User and Plesk IIS User still no luck.
I am using below link to upload files , the code wrking fine on my system with win 8 and studio2012 but when i put code on my hosting with shared hosting package the page giving error . my hosting runs on iis7.5. what to keep in web.config and what to remove. URL...
View 1 RepliesI recently ran into some strange problems. Changes to files that are not code-behind (and not gets compiled to a DLL) should not require you to recompile the whole website, and this has never been I problem for me. These should actually get compiled dynamically when you first access the resource, e.g. the first time when browsing an updated aspx-page in the browser.
But yesterday, during development of a website, I noticed that even the smallest changes in html, javascript or anything in the .aspx-files doesn't get reflected when I save and reload the page in my browser. Rebuilding doesn't help either, actually I'll have to do a "Rebuild All" (in Visual Studio 2008) in order to see the changes. This applies to all aspx-files in my project.
I tried with minor changes on files in another web application project on the same server, and there it works as it should. Something must has happened to this particular application, but I cannot figure out what. Do you have any ideas on how to solve this?
I recently ran into some strange problems. Changes to files that are not code-behind (and not gets compiled to a DLL) should not require you to recompile the whole website, and this has never been I problem for me.These should actually get compiled dynamically when you first access the resource, e.g. the first time when browsing an updated aspx-page in the browser.
But yesterday, during development of a website, I noticed that even the smallest changes in html, javascript or anything in the .aspx-files doesn't get reflected when I save and reload the page in my browser.Rebuilding doesn't help either, actually I'll have to do a "Rebuild All" (in Visual Studio 2008) in order to see the changes. This applies to all aspx-files in my project.I tried with minor changes on files in another web application project on the same server, and there it works as it should. Something must has happened to this particular application, but I cannot figure out what.Do you have any ideas on how to solve this?
I have an MVC 2.0 environment in a S#arp layout, everything works great, and I have Intellisense working in my aspx file (for things like HTML helpers and Model properties) As soon as I add the line:
[Code]....
To my web.config, I lose Intellisense on my aspx files! Does anyone have any idea of why this is happening? Or have any experience with this?
I have query the data from DB using row in array. ow to add external value in between Array ?
Example as below.
oSheet.Cells[4, 3] = + "*" QueryDB.Rows[r].ItemArray[0].ToString() + "*";
We have multiple themes and based on the employee login we need to set the themes. And my themes folder including images, style sheets etc resides outside my application ie inside my master page project.When i refer the theme to it i am receiving an error stating its not valid theme.Cant we refer the external themes and set it page.theme?Any idea on this?
View 5 Repliesi want to execute url such as www.google.com in the background when a button is pressed how do i do that.
View 2 Replies