.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Jscript as an embedded resource failing

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

I have a straight forward control that I am trying to embed a js script file as a resource for and I am having issues. It appears that the resource is being made and the webresource.axd line is included in the source of the rendered page, however when i try to access a function in the script it fails and pops the Object Required error. I have followed countless examples and the concept pretty straight forward, I just can't find the error, please help.

In the debugging code at the bottom the GetManifestResourceInfo returns null however the GetManifestResourceStream does appear to return the embedded resource.


protected override void  OnLoad(EventArgs e)
        Type rsType = this.GetType();
        ClientScriptManager cs = Page.ClientScript;

        if (!cs.IsClientScriptIncludeRegistered("ScrollingListBox"))

            cs.RegisterClientScriptInclude("ScrollingListBox", cs.GetWebResourceUrl(rsType, "KustomCControls.Javascript.ScrollingListBox.js"));
            if (!cs.IsClientScriptIncludeRegistered("ScrollingListBox"))
                throw new Exception("boom");
            //cs.RegisterStartupScript(rsType, "ScrollableListBoxStartup" + this.UniqueID, string.Format("__ScrollableListBoxRefineHeightAndWidth('{0}');", this.ClientID), true);

View Complete Post

More Related Resource Links

Saving Canvas and other UIElements as embedded resource

Hi All, I am trying to save a canvas and its content as an embedded resource to another assembly but in doing so I got a Non-Serializable exception. Is there a better way of doing this? Here is the code I used in embedding the Canvas: // create an assembly AssemblyName assemblyName = new AssemblyName(System.IO.Path.GetFileNameWithoutExtension(filename)); AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave); ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(assemblyName.Name, assemblyName.Name + ".dll"); // create a class TypeBuilder typeBuilder = moduleBuilder.DefineType("ModuleName", TypeAttributes.Public, typeof(EmbeddedBAML)); // Create a default constructor ConstructorBuilder constuctorDefault = typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes); ILGenerator ilGenerator = constuctorDefault.GetILGenerator(); ilGenerator.Emit(OpCodes.Ldarg_0); ilGenerator.Emit(OpCodes.Call, typeof(EmbeddedBAML).GetConstructor(Type.EmptyTypes)); ilGenerator.Emit(OpCodes.Ret); typeBuilder.CreateType(); IResourceWriter resourceWriter = assemblyBuilder.DefineResource(assemblyName.Name + ".canvas", "Contains the Canvas object",assemblyName.Name + ".canvas", ResourceAttributes.Pu

Unique Pack URIs for resources (embedded / content / resource files) in several assemblies

Hello, When using resources as files (build actione=none and copy if newer), I'm able to manage resources using something like this : "/file.ico". Whatever the owner assembly is, because all files are copied in the Debug / Release directory. I'd like to have a similar behavior with pack URIs. I don't want to specify which assembly is the owner of an embedded / content / resource file. It seems impossible because we need to specify the source assembly ("pack://assembly_08:,,,/file.ico"), I'd like something like : "pack://whatever_the_assembly:,,,/file.ico". Is it possible ? Any idea ? Thanks.

Setting form icon from embedded resource in layout

I have no trouble embedding resources into my project into the resx file and using them for things like ImageLists. For example selecting a background image for a control, I simply click on the [...] button in the properties window for background image and a popup window allows me to select "Project resource file: Resources.resx" and lists the selectable images I've already embedded to choose from.
Yet how come when I select a Form and click [...] to select its icon it forces me to browse on my hard disk for a file instead of linking directly to the already-embedded resource? I don't want to have to keep adding copies of the same icon for every form I want to apply it to. Is there a reason for this or a way around getting this to work properly using the layout manager? I've found some pages that talk about how to code it into the source and force it to work that way but I'd like to know how to do it in the designer.

problems running exe as an embedded resource from memory

i'm having some problems running exe from an embedded resource in memory
 public class Searcher
    public static void RunSearch(string path, string text)
      //Get the current assembly
      Assembly assembly = Assembly.GetExecutingAssembly();

      //Get the resource stream
      Stream resourceStream = assembly.GetManifestResourceStream("App.Utils.Search.exe");

      //Verify the internal exe exists
      if (resourceStream == null) return;

      //Read the raw bytes of the resource
      byte[] resourcesBuffer = new byte[resourceStream.Length];


Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Printing resource files



I have some resource files for localization and would like to print them. When I try to print them in Visual Studio (with File -> Print...) the button is disabled. Does anyone know how to print them? (Without copying each into word or excel)

Thanks and regards,

set messageTemplateResourceName from resource file in Validation appication block.



  I am using Validation application block in my project and want to set validation message from resource file, but not able to do that. I tried giving the path of resource file in messageTemplateResourceType and name of resource in messageTemplateResourceName. But it did not help as I only receive the message if I have set something in messageTemplate even after setting the resource file.

Here is my code:

<validator lowerBound="1" lowerBoundType="Inclusive" upperBound="250"
              upperBoundType="Inclusive" negated="false" messageTemplate=""
              messageTemplateResourceType="Asurion.jCare.Common.Resources.UIResources.PerilTypeAndDetailsSection, Asurion.jCare.Common.Resources, Version=, Culture=neutral, PublicKeyToken=null"
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.Enterpris

how to make a css style background image be linked to an image in the resource file


hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.

thanks in advance

Page Title from Resource file...



I have Resource file...

I am using following code for Display Lable Text...

<asp:Label ID="lblName" runat="server" Text="<%$ Resources:resource,NAME %>"></asp:Label>

and I want to use that name for page title...

so I used "me.page.resources.resource.NAME" in code behind page.

 but I want to use that NAME in

<%@ Page Language="VB"

Problem in accessing resource file dynamically.


Steps I have followed are
1.I have created myres.en-GB.resx file at C:.
2.then created locale specific myres.en-GB.resources using resgen at c: only,
resgen c:\myres.en-GB.resx
3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.
Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll
4.I have created one web application using vs 2008 & then build it.
5.Then placed both resource file & dll in web applications Bin\en-GB folder.
6.Anf finally written code at page load like
 CultureInfo info = new CultureInfo("en-GB");
            Thread.CurrentThread.CurrentCulture = info;
            Assembly asd = Assembly.Load("ClassLibrary1");
            ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info));
            string sdf = res.GetString("Lab1");

but after running application I m getting following error
MissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla

Can't read global resource in asp button


I have translated Text Ok in arabic and I have that placed in global Navig.resx file

<asp:Button ID

Web Deployment - Setup failing - aspnetca.exe


I have created websetup in windows 7 environment, asp.net 3.5, IIS 7.

Client System is windows 7 and IIS 7

Our client configuration is Windows 7, IIS7 dotNet Framework 3.5.
Following error raising below...
Faulting application name: aspnetca.exe, version: 7.5.7600.16385, time stamp: 0x4a5bcd3c
Faulting module name: aspnetca.exe, version: 7.5.7600.16385, time stamp: 0x4a5bcd3c
Exception code: 0xc0000005
Fault offset: 0x0001d912
Faulting process id: 0xe80
Faulting application start time: 0x01cb3604624975cd
Faulting application path: C:\Windows\system32\inetsrv\aspnetca.exe
Faulting module path: C:\Windows\system32\inetsrv\aspnetca.exe
Report Id: a05d368d-a1f7-11df-8336-4487fc612414
PFA Here I"m attaching custom action script. 

What's happening with JScript.NET


Years ago I had an interest in this language (which I think is a cool achievement).

There was writing on the wall that it was not a first class citizen, it never got editing support in VS.

I haven't given it much thought for years.

There is a compiler for it in .NET 2.  (jsc.exe)

I see that it's slated be in .NET 4 (though the DLR language managed JScript isn't).

I used the language in .NET 1 for it's eval and I see that others are doing the same.  (I also see that there are at least a few commercial uses, like Sony in Sound Forge and Vegas.)

Does anybody here have a good handle on the spectrum of people who are using it, the attitude of management in MS and any IDE support for the language?

Thread Performance: Resource Contention Concurrency Profiling in Visual Studio 2010


Visual Studio 2010 includes new resource contention profiling features that help detect concurrency contention among threads. We walk through a profiling investigation to demonstrate how you can pinpoint and fix resource contention problems in your code.

Maxim Goldin

MSDN Magazine June 2010

Test Run: Test automation with Windows XP Embedded


This month's column explores how to create lightweight but powerful UI test automation for software systems that run on Windows XP Embedded.

Dr. James McCaffrey and Mike Hall

MSDN Magazine October 2007

Mobilize: Explore The New Features In Windows Embedded CE 6.0


Paul Yao presents an overview of Windows Embedded CE 6.0.

Paul Yao

MSDN Magazine December 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend