Julian Jelfs’ Blog

ClientScriptManager.GetWebResourceUrl type parameter

Posted in Uncategorized by julianjelfs on November 22, 2009

So this method returns a URL reference to a resource embedded in an assembly. No problem with that – useful. The thing that annoys me about this is the first parameter. It is a parameter of type “Type” and according to the documentation describes the type of the resource. This is obviously nonsense. If I am embedding a javascript file in an assembly what type is that? typeof(javascript file) ? In the remarks section on the documentation we get a bit more information:

“You specify the type based on the object that will be accessing the resource”

Which seems again to be meaningless. What does this mean for a script file? It turns out that the only thing you have to make sure of really is that the type you specify belongs to the same assembly that the resource is embedded in otherwise it will not work. This is the one important point that the documentation does not clearly tell you.

Advertisements

3 Responses

Subscribe to comments with RSS.

  1. amit said, on December 1, 2009 at 9:56 pm

    Hi Julian,

    I have picked up your work from the watin. I had one question on watiN which i am not able to find on internat at all. my question is following

    Any help in this context is appreciated.
    thanks,
    Amit

    Question on blogs
    On http://watin.sourceforge.net/releasenotes-2-0-10-x.html it says that
    WatiN has been fixed to support running it from a locked workstation.
    However, that doesn’t seem to be the case. I am using 2.0 beta 1, and this
    code

    FileDownloadHandler fileDownloadHandler = new
    FileDownloadHandler(logFilePath);
    ie.AddDialogHandler(fileDownloadHandler);
    ie.Button(Find.ByName(“submitbutton”)).ClickNoWait();
    fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(300);
    fileDownloadHandler.WaitUntilDownloadCompleted(300);

    works fine when you are currently logged in, but when the computer is
    locked or logged off, the code still hangs and eventually times out with

    WatiN.Core.Exceptions.WatiNException: Has not shown dialog after 300
    seconds. at
    WatiN.Core.DialogHandlers.FileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(Int32
    waitDurationInSeconds)

    I know I am using the 2.0 beta 1 assemblies, because I can see the new
    FileDownloadHandler sending in the individual characters into the handler
    (“slow typing” vs the previous behavior of “pasting” in the full path).

    Thanks,

    • julianjelfs said, on December 2, 2009 at 8:23 am

      Sorry Amit but that’s beyond my expertise. I dabbled with WatiN a while ago and contributed a VBScript alert handler but I can’t help you on this one. I can only suggest checking the bug reports at the support page

  2. xr280xr said, on August 29, 2013 at 4:48 pm

    Thank you for confirming I’m not the only one using this stuff who thinks logically!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: