Using Javascript Local Reference?

Jan 25, 2010

In .Net I can use the "~/image/image.png" as a reference to a graphic in the image file in the image folder from whatever file or folder I am working with. How do i use this type of reference in a javascript where I need to reference a source file?

View 4 Replies


Similar Messages:

Visual Studio - Why Does Website Reference Assembly From GAC, When Adding Local Reference

Jan 7, 2010

When you use ASP.NET web site (instead of web application model) and add reference to an assembly from local folder, Visual Studio, it seems, understands that this local assembly is also in GAC and so does NOT copy this assembly to bin folder (as it does with non-GAC assemblies), but simply adds new record in web.config file.

Why such a behaviour? Is it possible to force copy to bin folder (I need this since .dll is not on target environment)? I can add assembly to bin folder as file and it will work, but in this case bin folder contents will be in source control, which is not good.

View 3 Replies

[Web Site] How To Change Reference To Local ( From GAC To Bin )

Jul 12, 2010

I've got MS Chart control and with a references to GAC.I found them ( C:Program FilesMicrosoft Chart ControlsAssemblies )but how to change GAC to local copy (bin) for comparability with other servers without installed MS Chart control for VS .I've tried to add dll files manually but that was a fail.It's looking like I need to config Web.Config manually.

change it,<add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>

somehow to move it from GAC to bin , so How ?

View 1 Replies

.net - Equivalent Of Reference 'Copy Local' In Web Site Project?

Nov 25, 2010

I don't see any exact duplicates in the Related Questions above, so here goes. Please don't stone me if it is a duplicate.Is there any way to achieve the same end as setting 'Copy Local' to True on a web application reference? I could probably map a custom config section to the <compilation><assemblies> config section, and simple copy all assemblies to local, but that would be quite rude. Should I be looking at tapping into a build provider or something? I think the main issue here is identifying listed assemblies not normally present on the target platform, but this seems a very difficult task to me without simply using a hard-coded list,

View 2 Replies

C# - Can One Local .resx String Reference Another Local .resx String

Jun 18, 2010

I am trying to determine if it is possible to add a concatenated string to one of my local .resx files. This example should clarify:

Let's say I have a simple ASP.NET webpage composed of (1) a label whose text is an important keyword (2) an input with required field validation and (3) a button that causes validation to occur:

(lblMyInput)
(txtMyInput)
(rfvMyInput)
(btnSubmit)

Now, inside the resource file for this page, we want to localize the strings for the page's controls. However, for our error message, we want to use the literal name of the input's label. This is were my question is.

PSEUDOCODE: myPage.resx

(1) lblMyInput.Text = "Name"
(2) rfvMyInput.ErrorMessage = "The " + lblMyInput.Text + " field may not be left blank."
(3) btnSubmit.Text = "Submit/Validate"

Is there any way to pull off this type of concatenation of one resource file's string into another string within the same file?

View 1 Replies

Get Contents Of Local Folder In Javascript?

Mar 21, 2010

Is it possible for a webpage to popup a open folder dialog, ask the user to select a folder, then show the contents of that folder in a list(or something) in the webpage. It won't write to the files, only read them. The webpage is hosted remotely.

View 6 Replies

Javascript - Reading Quoted Text From Local Resource File?

Jul 6, 2010

i'm using a little javascript in my website for my navigation bar, which is made up of a few ImageButton controls. in the code behind i have this:

Dim homeImage As String = GetLocalResourceObject("HomeImage")
imgBtnHome.Attributes.Add("OnMouseOver", HomeImage)

and in the resx file, i've tried these, but they don't work: (note the single and double quotes)

key: HomeImage value: "this.src='images/HomeImage.gif'"
key: HomeImage value: "this.src='images/HomeImage.gif'"

is it even possible to read "quoted" text from a local resource file?

View 1 Replies

How To Use Dynamic Javascript Reference

Apr 18, 2010

I've inherited some code (not mine- I swear!) which uses a session variable in the header of the HTML to determine which javascript file to link to.

<SCRIPT language="javascript" src="../JavaScript/<%=Session("jsFileName")%>.js"></SCRIPT>

It does work, except that it won't let me change to design view. It gives the message "Could not open in design view. Quote Values differently inside a '<%... "value" ...%>' block.

View 3 Replies

Add JavaScript Reference From Code Behind (C#)?

Sep 13, 2010

Is it possible to add javascript reference dynamically from code behind aspx.cs?Like this:

private void AddScriptReference(string path)
{
//Add reference to <head></head>
}

[code]...

View 2 Replies

Networking - Obtaining Client Computer Name On Local Network In Javascript Web Application?

Jan 27, 2011

I have an asp.net (FW 3.5) web app that runs on an internal network. One specific page needs to "report" in to the web server that it is active and not locked up. I need to be able to run a script (or something) at the client to report the pc's computer name in that report. I cannot find a method that does this. I found several things that would report the WAN IP or host name, but this appears to all be for external facing sites.

View 1 Replies

JQuery :: Reference A Javascript File In .net?

Jul 7, 2010

I have a hquery plugin that consists of jquery itself, 2 .js files and some script to configure the plug-in which resides on the page. I noticed that in .net you can create a .js file.What I would like to do is put the configuration inside a .js file created in .net, but how do I then reference this in the header of the page?am I over complicating the issue or just missing something?

View 5 Replies

Modify Every File That Contains A Javascript Reference?

Mar 24, 2010

I have some pages that reference javascript files.

The application exists locally in a Virtual Directory, i.e. http://localhost/MyVirtualDirectory/MyPage.aspx

so locally I reference the files as follows:

<script src="/MyVirtualDirectory/Scripts/MyScript.js" type="text/javascript"></script>

The production setup is different though. The application exists as its own web site in production, so I don't need to include the reference to the virtual directory. The problem with this is that I need to modify every file that contains a javascript reference so it looks like the following:

<script src="../Scripts/MyScript.js" type="text/javascript"></script>

I've tried referencing the files this way in my local setup but it doesn't work.

View 3 Replies

Reference An Anonymous JavaScript Function?

Apr 14, 2010

I'm trying to call a Page Method using a jQuery 'attached' event function, in which I like to use the closure to keep the event target local, as below, but page method calls declare several 'error' functions, and I would like to use one function for all of them. If, in the below code, I was handling an error and not success, how could I use my single, anonymous handler for all 3 error functions?

$(":button").click(function () {
var button = this;
PageMethods.DoIt(
function (a, b, c) {
alert(button);
});
});

This example passes an anonymous function for the success callback. There is only one of these. If I was passing an error callback, how could I use 'function (e, c, t)' for all 3 error callbacks?

ADDED: What I would like to do here is trigger an AJAX call whenever the user clicks a toggle button (checkbox), but to improve responsiveness, I want to toggle the button state immediately, and only 'untoggle' it if the AJAX call fails.

Now, in my client-side click() event handler, I would like to use anonymous functions inside the scope of click()' so that the functions have access to thethisevent argument, but I don't want to 'declare' three functions for theonTimeout,onError, and 'onAbort arguments of the PageMethods.MyFunction function. if I declare a named function outside of the click handler, it no longer has access to the 'this' parameter of the click() event handler.

View 6 Replies

JQuery :: How To Make Reference A Javascript File In .net

Apr 21, 2010

I have a hquery plugin that consists of jquery itself, 2 .js files and some script to configure the plug-in which resides on the page. I noticed that in .net you can create a .js file.What I would like to do is put the configuration inside a .js file created in .net, but how do I then reference this in the header of the page

View 1 Replies

Properly Reference A JavaScript File In A Project?

Apr 16, 2010

I have some pages that reference javascript files.

The application exists locally in a Virtual Directory, i.e. http://localhost/MyVirtualDirectory/MyPage.aspx

so locally I reference the files as follows:

<script src="/MyVirtualDirectory/Scripts/MyScript.js" type="text/javascript"></script>

The production setup is different though. The application exists as its own web site in production, so I don't need to include the reference to the virtual directory. The problem with this is that I need to modify every file that contains a javascript reference so it looks like the following:

<script src="../Scripts/MyScript.js" type="text/javascript"></script>

I've tried referencing the files this way in my local setup but it doesn't work.

View 1 Replies

AJAX :: Application Is Working Fine In Local, But It Is Giving JavaScript Error After Deploy In Dev Server

Jul 19, 2010

I am working on ASP.NET Ajax site. Application is working fine when I run in my local machine, but same code if I place in Server then it is giving "SpanID is undefined" Javascript error. I found error is due to UI.dll file.

View 2 Replies

JQuery :: How To Include Javascript Reference In Master Page

Nov 2, 2010

I am using Asp.Net C# 2.0. My website is working fine in local. Website contains 2 js files included in master page. It works fine in local environment, but when i publish my website i get "Object expected" error on page load, and thus the js functions are not working in published website.

Currently i am writing <script src="/javascripts/jquery.hotkeys-0.7.9.js" type="text/javascript"></script> in master page.

View 5 Replies

Jquery - Reference Form By Name In Javascript Using An BeginForm Html Helper

Apr 5, 2011

I'm sure I'm going about this wrong but I'm trying to write a simple javascript method that will set a hidden type value upon a link click. I'm using the Html.BeginForm() helper that contains two links similar to:

@Html.ActionLink("Delete Review Only", "Delete", new { id = Model.ReviewId }, new { onclick = "SetDeleteType(1);" })

<script language="JavaScript" type="text/javascript">
function SetDeleteType(selectedtype) {
document.supportform.deleteType.value = selectedtype;
document.supportform.submit();
}

The supportform name obviously doesn't exists since I'm using BeginForm() and can't specify a form name. Is there a clever way of doing this without calling Forms(0) using jQuery or something or am I completely off?

View 1 Replies

AJAX :: Reference To A JavaScript File To Use In HTML Editor Content?

Jan 6, 2010

I wish to execute a javascript function in HTML Editor content. Hower, I give me the error "object expected". It seems like the browser cannot locate my javascript file.

Here is my setup:

- I have an external javascript file, "myscript.js" under "script" folder which has "test" function which contains a single "alert()" command.

- I referenced to "myscript.js" via <script src=....> tag (and also tried using Script manager's ScriptReference Path, same result).

- In my default.aspx page, I have a button which call "test" on mouseover event, which works call "test" correctly whenever I mouseover.

- In my default.aspx, I have the HTML Editor, with the this HTML content:

<span id="0001" onmouseover="alert('ok');">OK</span>
<span id="0002" onmouseover="test('not ok');">Not OK</span>

When I mouseover "ok" alert() script executed, but it give "object expected" error on I mouse over "not ok", it look like the browser cannot find "test" in myscript.js.

How do I reference this a script file inside the HTML Editor content?

View 6 Replies

Dynamic Javascript Reference Gives The Message Could Not Open In Design View?

Feb 21, 2011

I've inherited some code (not mine- I swear!) which uses a session variable in the header of the HTML to determine which javascript file to link to.i.e.

<SCRIPT language="javascript" src="../JavaScript/<%=Session("jsFileName")%>.js"></SCRIPT>

It does work, except that it won't let me change to design view. It gives the message

"Could not open in design view. Quote Values differently inside a '<%... "value" ...%>' block."

Anyone got any suggestions as to a workaround, that doesn't involve a huge rewrite.

View 3 Replies

Javascript - Accessing The MasterTableView Edit Form In Radgrid To Get Reference To Textbox?

Mar 11, 2011

accessing the currently edited existing row in the Radgrid, as as well as the index of the Edit form when trying to add a new record to the table/

function OnClientSelectedIndexChanged(sender, eventArgs) {
var item = eventArgs.get_item();
// alert(item.get_value());
grid = $find("<%= rgSecurity.ClientID %>");

[Code]....

View 1 Replies

C# - Application Finds Local Resource Files In Web Development Server But Not Local IIS

Sep 22, 2010

When I run the application using the Web Developer it works fine. However when I run it using local IIS I get the following error:

The resource class for this page was not found. check if the resource file exists and try again. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The resource class for this page was not found. heck if the resource file exists and try again.

Source Error:

Line 81: private void PopulateLanguageList()
Line 82: {
Line 83: DropDownListLanguage.Items[0].Text = (string)HttpContext.GetLocalResourceObject(
Line 84: "Default.aspx", SelectLanguage, Thread.CurrentThread.CurrentCulture);
Line 85: }

Stack Trace:

[InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again.]
System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager() +4038050
System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager() +23
System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture) +24
System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +32
System.Web.HttpContext.GetLocalResourceObject(String virtualPath, String resourceKey, CultureInfo culture) +56
APPortal.Login.PopulateLanguageList() in c:inetpubwwwrootAPPortalDefault.aspx.cs:83
APPortal.Login.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootAPPortalDefault.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

View 1 Replies

When Publish Website To Local Folder And Access On Local Pc, Java Script Files Did Not Work

Mar 29, 2011

I created a website using VS2010. When I run the website using built-in web server, everything works fine. The website recognizes javascript and aurigma uploader. When I publish the website to local folder and tried to access using IIS 5.1 on local pc,
the java scipt files did not work. I was getting yellow triangle sign at the bottom of the page indicating the object is expected. I tried to look online but i could not find any answer. I have included jquery and javascript file in the header section of master

View 3 Replies

Hyperlink To Local File - Local Drive Letter And Network?

Oct 1, 2010

There is a hyperlink to a local file...for instance....C:/text.txt. This is not possible, because ASP.net does not allow links to local files. But, links to files on network drives such as W:/test.txt are working ok. how does the browser know which drive letter is local,and which is networked? How does it know that C: is local or D: is local etc, and that W: is a network drive?

View 1 Replies

Visual Studio :: Reference JavaScript Library From Multiple Websites Without Copying It To Each Project Folder

May 13, 2010

I have several web sites, all of which use the same JavaScript library. How can I "reference" this library from each of my web sites? If I just import the library into my web site in Visual Studio, I get in trouble as soon as the library changes, because I then have to update it in all web sites manually. It would be much easier to place the library in an external folder and just reference it from my web sites. How can I do this with Visual Studio?

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved