473,287 Members | 3,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

webresource not working in asp.net 2.0 beta

Okay, I am trying to do is to test the webresource in 2.0

1. I created a new project with assembly name (and default assembly name)
"Office".

2. I added the following to the AssemblyInfo.cs file (present under the
Properties folder of the project)
[assembly: System.Web.UI.WebResource("Office.test.js",
"application/x-javascript")]

3. Now I created a file called test.js on the root folder of the project,
having only a single line as:

alert(2);

4. I then marked the test.js file as embedded resource.

5. Now in a file called login.aspx (at the root) I added the following,

<script runat="server">
protected void Page_PreRender(object o, EventArgs e)
{
string scriptLocation =
this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(), "Office.test.js");
this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
scriptLocation);
}
</script>

6. This produces the web resource on the rendered source as:
<script
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>

So far so good, but it is not executing the javascript. To test everything
is okay, I changed the script location (hardcoded) in login.aspx to:
string scriptLocation = "/newoc/test.js"; // where newoc is my virtual
directory.

Now the alert gets shown when the page is rendered (as it should). It is not
getting it from webresource.

What I am doing wrong? any pointer will be of great help.

Thanks

--
-jojobar
Nov 19 '05 #1
8 2475
Hi Jojobar,

Welcome again.
As for the embeded webresource, from the code and the steps you provided,
all seems good. I think we can check from the following steps:

1. first use ildasm tool to check the compiled class library assembly so as
to confirm the image file is correctly embeded.

2. Then, since the web page will contains the dynamic resource's url like:

<script
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>

you can directly pick up the "src" attribute's value and paste in the IE
browser to see whether the content can displayed.

BTW, for class library project, we can put the
[assembly:System.Web.UI.WebResource(

attribute in any source file(which will be compiled into the class liblrary
assembly) in the project , not forced to be put in
AssemlyInfo.cs file.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| Subject: webresource not working in asp.net 2.0 beta
| Date: Wed, 26 Oct 2005 16:38:06 -0700
| Lines: 47
| Message-ID: <7F**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134152
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Okay, I am trying to do is to test the webresource in 2.0
|
| 1. I created a new project with assembly name (and default assembly name)
| "Office".
|
| 2. I added the following to the AssemblyInfo.cs file (present under the
| Properties folder of the project)
| [assembly: System.Web.UI.WebResource("Office.test.js",
| "application/x-javascript")]
|
| 3. Now I created a file called test.js on the root folder of the project,
| having only a single line as:
|
| alert(2);
|
| 4. I then marked the test.js file as embedded resource.
|
| 5. Now in a file called login.aspx (at the root) I added the following,
|
| <script runat="server">
| protected void Page_PreRender(object o, EventArgs e)
| {
| string scriptLocation =
| this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
"Office.test.js");
|
this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| scriptLocation);
| }
| </script>
|
| 6. This produces the web resource on the rendered source as:
| <script
|
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>
|
| So far so good, but it is not executing the javascript. To test
everything
| is okay, I changed the script location (hardcoded) in login.aspx to:
| string scriptLocation = "/newoc/test.js"; // where newoc is my virtual
| directory.
|
| Now the alert gets shown when the page is rendered (as it should). It is
not
| getting it from webresource.
|
| What I am doing wrong? any pointer will be of great help.
|
| Thanks
|
| --
| -jojobar
|

Nov 19 '05 #2
I checked in ildasm and it seems to be there. Also to test it I had put a lot
of just comment in the resource file and the assembly size increased.

However when I paste the src on the browser like:

http://localhost/newoc/WebResource.a...60016096250000

It said that the WebResource.axd could not be found. Maybe some iis settings
needs to be done.

However, when I see the source of my aspx file (from the browser), it shows
many such webresource.axd entries and all the other ones work!
--
-jojobar
"Steven Cheng[MSFT]" wrote:
Hi Jojobar,

Welcome again.
As for the embeded webresource, from the code and the steps you provided,
all seems good. I think we can check from the following steps:

1. first use ildasm tool to check the compiled class library assembly so as
to confirm the image file is correctly embeded.

2. Then, since the web page will contains the dynamic resource's url like:

<script
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>

you can directly pick up the "src" attribute's value and paste in the IE
browser to see whether the content can displayed.

BTW, for class library project, we can put the
[assembly:System.Web.UI.WebResource(

attribute in any source file(which will be compiled into the class liblrary
assembly) in the project , not forced to be put in
AssemlyInfo.cs file.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| Subject: webresource not working in asp.net 2.0 beta
| Date: Wed, 26 Oct 2005 16:38:06 -0700
| Lines: 47
| Message-ID: <7F**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134152
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Okay, I am trying to do is to test the webresource in 2.0
|
| 1. I created a new project with assembly name (and default assembly name)
| "Office".
|
| 2. I added the following to the AssemblyInfo.cs file (present under the
| Properties folder of the project)
| [assembly: System.Web.UI.WebResource("Office.test.js",
| "application/x-javascript")]
|
| 3. Now I created a file called test.js on the root folder of the project,
| having only a single line as:
|
| alert(2);
|
| 4. I then marked the test.js file as embedded resource.
|
| 5. Now in a file called login.aspx (at the root) I added the following,
|
| <script runat="server">
| protected void Page_PreRender(object o, EventArgs e)
| {
| string scriptLocation =
| this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
"Office.test.js");
|
this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| scriptLocation);
| }
| </script>
|
| 6. This produces the web resource on the rendered source as:
| <script
|
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>
|
| So far so good, but it is not executing the javascript. To test
everything
| is okay, I changed the script location (hardcoded) in login.aspx to:
| string scriptLocation = "/newoc/test.js"; // where newoc is my virtual
| directory.
|
| Now the alert gets shown when the page is rendered (as it should). It is
not
| getting it from webresource.
|
| What I am doing wrong? any pointer will be of great help.
|
| Thanks
|
| --
| -jojobar
|

Nov 19 '05 #3
Another thing,

When I paste another webresource.axd on the browser (that microsoft
produced), it is not giving any error!
--
-jojobar
"Steven Cheng[MSFT]" wrote:
Hi Jojobar,

Welcome again.
As for the embeded webresource, from the code and the steps you provided,
all seems good. I think we can check from the following steps:

1. first use ildasm tool to check the compiled class library assembly so as
to confirm the image file is correctly embeded.

2. Then, since the web page will contains the dynamic resource's url like:

<script
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>

you can directly pick up the "src" attribute's value and paste in the IE
browser to see whether the content can displayed.

BTW, for class library project, we can put the
[assembly:System.Web.UI.WebResource(

attribute in any source file(which will be compiled into the class liblrary
assembly) in the project , not forced to be put in
AssemlyInfo.cs file.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| Subject: webresource not working in asp.net 2.0 beta
| Date: Wed, 26 Oct 2005 16:38:06 -0700
| Lines: 47
| Message-ID: <7F**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134152
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Okay, I am trying to do is to test the webresource in 2.0
|
| 1. I created a new project with assembly name (and default assembly name)
| "Office".
|
| 2. I added the following to the AssemblyInfo.cs file (present under the
| Properties folder of the project)
| [assembly: System.Web.UI.WebResource("Office.test.js",
| "application/x-javascript")]
|
| 3. Now I created a file called test.js on the root folder of the project,
| having only a single line as:
|
| alert(2);
|
| 4. I then marked the test.js file as embedded resource.
|
| 5. Now in a file called login.aspx (at the root) I added the following,
|
| <script runat="server">
| protected void Page_PreRender(object o, EventArgs e)
| {
| string scriptLocation =
| this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
"Office.test.js");
|
this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| scriptLocation);
| }
| </script>
|
| 6. This produces the web resource on the rendered source as:
| <script
|
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>
|
| So far so good, but it is not executing the javascript. To test
everything
| is okay, I changed the script location (hardcoded) in login.aspx to:
| string scriptLocation = "/newoc/test.js"; // where newoc is my virtual
| directory.
|
| Now the alert gets shown when the page is rendered (as it should). It is
not
| getting it from webresource.
|
| What I am doing wrong? any pointer will be of great help.
|
| Thanks
|
| --
| -jojobar
|

Nov 19 '05 #4
Yet another thing...

any ideas where to look for in ildasm if the resource is embedded? I looked
at the manifest and found it, but I cannot see the content. I know that it
is in there because the assembly size has roughly increased equivalent to the
number of bytes in the resource file.

Thanks again
--
-jojobar
"Steven Cheng[MSFT]" wrote:
Hi Jojobar,

Welcome again.
As for the embeded webresource, from the code and the steps you provided,
all seems good. I think we can check from the following steps:

1. first use ildasm tool to check the compiled class library assembly so as
to confirm the image file is correctly embeded.

2. Then, since the web page will contains the dynamic resource's url like:

<script
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>

you can directly pick up the "src" attribute's value and paste in the IE
browser to see whether the content can displayed.

BTW, for class library project, we can put the
[assembly:System.Web.UI.WebResource(

attribute in any source file(which will be compiled into the class liblrary
assembly) in the project , not forced to be put in
AssemlyInfo.cs file.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| Subject: webresource not working in asp.net 2.0 beta
| Date: Wed, 26 Oct 2005 16:38:06 -0700
| Lines: 47
| Message-ID: <7F**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134152
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Okay, I am trying to do is to test the webresource in 2.0
|
| 1. I created a new project with assembly name (and default assembly name)
| "Office".
|
| 2. I added the following to the AssemblyInfo.cs file (present under the
| Properties folder of the project)
| [assembly: System.Web.UI.WebResource("Office.test.js",
| "application/x-javascript")]
|
| 3. Now I created a file called test.js on the root folder of the project,
| having only a single line as:
|
| alert(2);
|
| 4. I then marked the test.js file as embedded resource.
|
| 5. Now in a file called login.aspx (at the root) I added the following,
|
| <script runat="server">
| protected void Page_PreRender(object o, EventArgs e)
| {
| string scriptLocation =
| this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
"Office.test.js");
|
this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| scriptLocation);
| }
| </script>
|
| 6. This produces the web resource on the rendered source as:
| <script
|
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
7LgDQ-rSE3fGRgtkb60&t=632659511657343750" type="text/javascript"></script>
|
| So far so good, but it is not executing the javascript. To test
everything
| is okay, I changed the script location (hardcoded) in login.aspx to:
| string scriptLocation = "/newoc/test.js"; // where newoc is my virtual
| directory.
|
| Now the alert gets shown when the page is rendered (as it should). It is
not
| getting it from webresource.
|
| What I am doing wrong? any pointer will be of great help.
|
| Thanks
|
| --
| -jojobar
|

Nov 19 '05 #5
Hi Jojobar,

Seems strange, have you tried creating a new project to see whether the
problem remains? It is likely a environment specific problem. Also, as for
the ILDASM, we can only see the resource's name and address (offset....)
from the Manifest section, the content can not be displayed since they've
been stored as binary image in assembly. Also, have you tried other kind
of resource like gif/jpeg pictures to see whether they can be retrieved
correctly?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXa/Q3mtLA2ZOBzR5OWNLCfkfo9Jg==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <7F**********************************@microsoft.co m>
<2V**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: webresource not working in asp.net 2.0 beta
| Date: Thu, 27 Oct 2005 06:48:04 -0700
| Lines: 132
| Message-ID: <07**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134242
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Yet another thing...
|
| any ideas where to look for in ildasm if the resource is embedded? I
looked
| at the manifest and found it, but I cannot see the content. I know that
it
| is in there because the assembly size has roughly increased equivalent to
the
| number of bytes in the resource file.
|
| Thanks again
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Jojobar,
| >
| > Welcome again.
| > As for the embeded webresource, from the code and the steps you
provided,
| > all seems good. I think we can check from the following steps:
| >
| > 1. first use ildasm tool to check the compiled class library assembly
so as
| > to confirm the image file is correctly embeded.
| >
| > 2. Then, since the web page will contains the dynamic resource's url
like:
| >
| > <script
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| > 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
type="text/javascript"></script>
| >
| > you can directly pick up the "src" attribute's value and paste in the
IE
| > browser to see whether the content can displayed.
| >
| > BTW, for class library project, we can put the
| > [assembly:System.Web.UI.WebResource(
| >
| > attribute in any source file(which will be compiled into the class
liblrary
| > assembly) in the project , not forced to be put in
| > AssemlyInfo.cs file.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: webresource not working in asp.net 2.0 beta
| > | thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| > | X-WBNR-Posting-Host: 66.32.181.251
| > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | Subject: webresource not working in asp.net 2.0 beta
| > | Date: Wed, 26 Oct 2005 16:38:06 -0700
| > | Lines: 47
| > | Message-ID: <7F**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:134152
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Okay, I am trying to do is to test the webresource in 2.0
| > |
| > | 1. I created a new project with assembly name (and default assembly
name)
| > | "Office".
| > |
| > | 2. I added the following to the AssemblyInfo.cs file (present under
the
| > | Properties folder of the project)
| > | [assembly: System.Web.UI.WebResource("Office.test.js",
| > | "application/x-javascript")]
| > |
| > | 3. Now I created a file called test.js on the root folder of the
project,
| > | having only a single line as:
| > |
| > | alert(2);
| > |
| > | 4. I then marked the test.js file as embedded resource.
| > |
| > | 5. Now in a file called login.aspx (at the root) I added the
following,
| > |
| > | <script runat="server">
| > | protected void Page_PreRender(object o, EventArgs e)
| > | {
| > | string scriptLocation =
| > | this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
| > "Office.test.js");
| > |
| > this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| > | scriptLocation);
| > | }
| > | </script>
| > |
| > | 6. This produces the web resource on the rendered source as:
| > | <script
| > |
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| > 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
type="text/javascript"></script>
| > |
| > | So far so good, but it is not executing the javascript. To test
| > everything
| > | is okay, I changed the script location (hardcoded) in login.aspx to:
| > | string scriptLocation = "/newoc/test.js"; // where newoc is my
virtual
| > | directory.
| > |
| > | Now the alert gets shown when the page is rendered (as it should). It
is
| > not
| > | getting it from webresource.
| > |
| > | What I am doing wrong? any pointer will be of great help.
| > |
| > | Thanks
| > |
| > | --
| > | -jojobar
| > |
| >
| >
|

Nov 19 '05 #6
Thanks again Steven,

It seems strange to me too! I tried all different things I know about or
have read from the internet. I bet it must be a simple thing I am missing.

I will also try the two things you suggested (try it in a different project
and try on image/gif files) and let you know.

What puzzles me most is that the ms resources are working fine. So, I think
somewhere I am making a mistake in defining the webresources or calling them!

Regards
jojobar
--
-jojobar
"Steven Cheng[MSFT]" wrote:
Hi Jojobar,

Seems strange, have you tried creating a new project to see whether the
problem remains? It is likely a environment specific problem. Also, as for
the ILDASM, we can only see the resource's name and address (offset....)
from the Manifest section, the content can not be displayed since they've
been stored as binary image in assembly. Also, have you tried other kind
of resource like gif/jpeg pictures to see whether they can be retrieved
correctly?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXa/Q3mtLA2ZOBzR5OWNLCfkfo9Jg==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <7F**********************************@microsoft.co m>
<2V**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: webresource not working in asp.net 2.0 beta
| Date: Thu, 27 Oct 2005 06:48:04 -0700
| Lines: 132
| Message-ID: <07**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134242
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Yet another thing...
|
| any ideas where to look for in ildasm if the resource is embedded? I
looked
| at the manifest and found it, but I cannot see the content. I know that
it
| is in there because the assembly size has roughly increased equivalent to
the
| number of bytes in the resource file.
|
| Thanks again
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Jojobar,
| >
| > Welcome again.
| > As for the embeded webresource, from the code and the steps you
provided,
| > all seems good. I think we can check from the following steps:
| >
| > 1. first use ildasm tool to check the compiled class library assembly
so as
| > to confirm the image file is correctly embeded.
| >
| > 2. Then, since the web page will contains the dynamic resource's url
like:
| >
| > <script
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| > 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
type="text/javascript"></script>
| >
| > you can directly pick up the "src" attribute's value and paste in the
IE
| > browser to see whether the content can displayed.
| >
| > BTW, for class library project, we can put the
| > [assembly:System.Web.UI.WebResource(
| >
| > attribute in any source file(which will be compiled into the class
liblrary
| > assembly) in the project , not forced to be put in
| > AssemlyInfo.cs file.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: webresource not working in asp.net 2.0 beta
| > | thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| > | X-WBNR-Posting-Host: 66.32.181.251
| > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | Subject: webresource not working in asp.net 2.0 beta
| > | Date: Wed, 26 Oct 2005 16:38:06 -0700
| > | Lines: 47
| > | Message-ID: <7F**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:134152
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Okay, I am trying to do is to test the webresource in 2.0
| > |
| > | 1. I created a new project with assembly name (and default assembly
name)
| > | "Office".
| > |
| > | 2. I added the following to the AssemblyInfo.cs file (present under
the
| > | Properties folder of the project)
| > | [assembly: System.Web.UI.WebResource("Office.test.js",
| > | "application/x-javascript")]
| > |
| > | 3. Now I created a file called test.js on the root folder of the
project,
| > | having only a single line as:
| > |
| > | alert(2);
| > |
| > | 4. I then marked the test.js file as embedded resource.
| > |
| > | 5. Now in a file called login.aspx (at the root) I added the
following,
| > |
| > | <script runat="server">
| > | protected void Page_PreRender(object o, EventArgs e)
| > | {
| > | string scriptLocation =
| > | this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
| > "Office.test.js");
| > |
| > this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| > | scriptLocation);
| > | }
| > | </script>
| > |
| > | 6. This produces the web resource on the rendered source as:
| > | <script
| > |
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| > 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
type="text/javascript"></script>
| > |
| > | So far so good, but it is not executing the javascript. To test
| > everything
| > | is okay, I changed the script location (hardcoded) in login.aspx to:
| > | string scriptLocation = "/newoc/test.js"; // where newoc is my
virtual
| > | directory.
| > |
| > | Now the alert gets shown when the page is rendered (as it should). It
is
| > not
| > | getting it from webresource.
| > |
| > | What I am doing wrong? any pointer will be of great help.
| > |
| > | Thanks
| > |
| > | --
| > | -jojobar
| > |
| >
| >
|

Nov 19 '05 #7
Thanks for the response.

OK. If there're any new updates or anything else need assistance, please
feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXbbRYP1G+6pmb2SCma4n2I1W798Q==
| X-WBNR-Posting-Host: 24.30.72.206
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <7F**********************************@microsoft.co m>
<2V**************@TK2MSFTNGXA01.phx.gbl>
<07**********************************@microsoft.co m>
<qe**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: webresource not working in asp.net 2.0 beta
| Date: Thu, 27 Oct 2005 20:10:02 -0700
| Lines: 222
| Message-ID: <4E**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134451
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks again Steven,
|
| It seems strange to me too! I tried all different things I know about or
| have read from the internet. I bet it must be a simple thing I am missing.
|
| I will also try the two things you suggested (try it in a different
project
| and try on image/gif files) and let you know.
|
| What puzzles me most is that the ms resources are working fine. So, I
think
| somewhere I am making a mistake in defining the webresources or calling
them!
|
| Regards
| jojobar
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Jojobar,
| >
| > Seems strange, have you tried creating a new project to see whether the
| > problem remains? It is likely a environment specific problem. Also, as
for
| > the ILDASM, we can only see the resource's name and address
(offset....)
| > from the Manifest section, the content can not be displayed since
they've
| > been stored as binary image in assembly. Also, have you tried other
kind
| > of resource like gif/jpeg pictures to see whether they can be
retrieved
| > correctly?
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: webresource not working in asp.net 2.0 beta
| > | thread-index: AcXa/Q3mtLA2ZOBzR5OWNLCfkfo9Jg==
| > | X-WBNR-Posting-Host: 66.32.181.251
| > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | References: <7F**********************************@microsoft.co m>
| > <2V**************@TK2MSFTNGXA01.phx.gbl>
| > | Subject: RE: webresource not working in asp.net 2.0 beta
| > | Date: Thu, 27 Oct 2005 06:48:04 -0700
| > | Lines: 132
| > | Message-ID: <07**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:134242
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Yet another thing...
| > |
| > | any ideas where to look for in ildasm if the resource is embedded? I
| > looked
| > | at the manifest and found it, but I cannot see the content. I know
that
| > it
| > | is in there because the assembly size has roughly increased
equivalent to
| > the
| > | number of bytes in the resource file.
| > |
| > | Thanks again
| > | --
| > | -jojobar
| > |
| > |
| > | "Steven Cheng[MSFT]" wrote:
| > |
| > | > Hi Jojobar,
| > | >
| > | > Welcome again.
| > | > As for the embeded webresource, from the code and the steps you
| > provided,
| > | > all seems good. I think we can check from the following steps:
| > | >
| > | > 1. first use ildasm tool to check the compiled class library
assembly
| > so as
| > | > to confirm the image file is correctly embeded.
| > | >
| > | > 2. Then, since the web page will contains the dynamic resource's
url
| > like:
| > | >
| > | > <script
| > | >
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| > | > 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
| > type="text/javascript"></script>
| > | >
| > | > you can directly pick up the "src" attribute's value and paste in
the
| > IE
| > | > browser to see whether the content can displayed.
| > | >
| > | > BTW, for class library project, we can put the
| > | > [assembly:System.Web.UI.WebResource(
| > | >
| > | > attribute in any source file(which will be compiled into the class
| > liblrary
| > | > assembly) in the project , not forced to be put in
| > | > AssemlyInfo.cs file.
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | Thread-Topic: webresource not working in asp.net 2.0 beta
| > | > | thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| > | > | X-WBNR-Posting-Host: 66.32.181.251
| > | > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | > | Subject: webresource not working in asp.net 2.0 beta
| > | > | Date: Wed, 26 Oct 2005 16:38:06 -0700
| > | > | Lines: 47
| > | > | Message-ID: <7F**********************************@microsoft.co m>
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain;
| > | > | charset="Utf-8"
| > | > | Content-Transfer-Encoding: 7bit
| > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | Content-Class: urn:content-classes:message
| > | > | Importance: normal
| > | > | Priority: normal
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path:
| > TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:134152
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | Okay, I am trying to do is to test the webresource in 2.0
| > | > |
| > | > | 1. I created a new project with assembly name (and default
assembly
| > name)
| > | > | "Office".
| > | > |
| > | > | 2. I added the following to the AssemblyInfo.cs file (present
under
| > the
| > | > | Properties folder of the project)
| > | > | [assembly: System.Web.UI.WebResource("Office.test.js",
| > | > | "application/x-javascript")]
| > | > |
| > | > | 3. Now I created a file called test.js on the root folder of the
| > project,
| > | > | having only a single line as:
| > | > |
| > | > | alert(2);
| > | > |
| > | > | 4. I then marked the test.js file as embedded resource.
| > | > |
| > | > | 5. Now in a file called login.aspx (at the root) I added the
| > following,
| > | > |
| > | > | <script runat="server">
| > | > | protected void Page_PreRender(object o, EventArgs e)
| > | > | {
| > | > | string scriptLocation =
| > | > | this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
| > | > "Office.test.js");
| > | > |
| > | > this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| > | > | scriptLocation);
| > | > | }
| > | > | </script>
| > | > |
| > | > | 6. This produces the web resource on the rendered source as:
| > | > | <script
| > | > |
| > | >
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| > | > 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
| > type="text/javascript"></script>
| > | > |
| > | > | So far so good, but it is not executing the javascript. To test
| > | > everything
| > | > | is okay, I changed the script location (hardcoded) in login.aspx
to:
| > | > | string scriptLocation = "/newoc/test.js"; // where newoc is my
| > virtual
| > | > | directory.
| > | > |
| > | > | Now the alert gets shown when the page is rendered (as it
should). It
| > is
| > | > not
| > | > | getting it from webresource.
| > | > |
| > | > | What I am doing wrong? any pointer will be of great help.
| > | > |
| > | > | Thanks
| > | > |
| > | > | --
| > | > | -jojobar
| > | > |
| > | >
| > | >
| > |
| >
| >
|

Nov 19 '05 #8
I'm having this same exact issue. Any chance this was resolved? Thanks
Andy

"Steven Cheng[MSFT]" wrote:
Thanks for the response.

OK. If there're any new updates or anything else need assistance, please
feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: webresource not working in asp.net 2.0 beta
| thread-index: AcXbbRYP1G+6pmb2SCma4n2I1W798Q==
| X-WBNR-Posting-Host: 24.30.72.206
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <7F**********************************@microsoft.co m>
<2V**************@TK2MSFTNGXA01.phx.gbl>
<07**********************************@microsoft.co m>
<qe**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: webresource not working in asp.net 2.0 beta
| Date: Thu, 27 Oct 2005 20:10:02 -0700
| Lines: 222
| Message-ID: <4E**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134451
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks again Steven,
|
| It seems strange to me too! I tried all different things I know about or
| have read from the internet. I bet it must be a simple thing I am missing.
|
| I will also try the two things you suggested (try it in a different
project
| and try on image/gif files) and let you know.
|
| What puzzles me most is that the ms resources are working fine. So, I
think
| somewhere I am making a mistake in defining the webresources or calling
them!
|
| Regards
| jojobar
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| Hi Jojobar,
| >
| Seems strange, have you tried creating a new project to see whether the
| problem remains? It is likely a environment specific problem. Also, as
for
| the ILDASM, we can only see the resource's name and address
(offset....)
| from the Manifest section, the content can not be displayed since
they've
| been stored as binary image in assembly. Also, have you tried other
kind
| of resource like gif/jpeg pictures to see whether they can be
retrieved
| correctly?
| >
| Thanks,
| >
| Steven Cheng
| Microsoft Online Support
| >
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
| >
| >
| >
| >
| --------------------
| | Thread-Topic: webresource not working in asp.net 2.0 beta
| | thread-index: AcXa/Q3mtLA2ZOBzR5OWNLCfkfo9Jg==
| | X-WBNR-Posting-Host: 66.32.181.251
| | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| | References: <7F**********************************@microsoft.co m>
| <2V**************@TK2MSFTNGXA01.phx.gbl>
| | Subject: RE: webresource not working in asp.net 2.0 beta
| | Date: Thu, 27 Oct 2005 06:48:04 -0700
| | Lines: 132
| | Message-ID: <07**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet:134242
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Yet another thing...
| |
| | any ideas where to look for in ildasm if the resource is embedded? I
| looked
| | at the manifest and found it, but I cannot see the content. I know
that
| it
| | is in there because the assembly size has roughly increased
equivalent to
| the
| | number of bytes in the resource file.
| |
| | Thanks again
| | --
| | -jojobar
| |
| |
| | "Steven Cheng[MSFT]" wrote:
| |
| | Hi Jojobar,
| | >
| | Welcome again.
| | As for the embeded webresource, from the code and the steps you
| provided,
| | all seems good. I think we can check from the following steps:
| | >
| | 1. first use ildasm tool to check the compiled class library
assembly
| so as
| | to confirm the image file is correctly embeded.
| | >
| | 2. Then, since the web page will contains the dynamic resource's
url
| like:
| | >
| | <script
| | >
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| | 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
| type="text/javascript"></script>
| | >
| | you can directly pick up the "src" attribute's value and paste in
the
| IE
| | browser to see whether the content can displayed.
| | >
| | BTW, for class library project, we can put the
| | [assembly:System.Web.UI.WebResource(
| | >
| | attribute in any source file(which will be compiled into the class
| liblrary
| | assembly) in the project , not forced to be put in
| | AssemlyInfo.cs file.
| | >
| | Thanks,
| | >
| | Steven Cheng
| | Microsoft Online Support
| | >
| | Get Secure! www.microsoft.com/security
| | (This posting is provided "AS IS", with no warranties, and confers
no
| | rights.)
| | >
| | >
| | >
| | >
| | --------------------
| | | Thread-Topic: webresource not working in asp.net 2.0 beta
| | | thread-index: AcXahlCZ47P21P4tRHSpOlb9X4Y73w==
| | | X-WBNR-Posting-Host: 66.32.181.251
| | | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| | | Subject: webresource not working in asp.net 2.0 beta
| | | Date: Wed, 26 Oct 2005 16:38:06 -0700
| | | Lines: 47
| | | Message-ID: <7F**********************************@microsoft.co m>
| | | MIME-Version: 1.0
| | | Content-Type: text/plain;
| | | charset="Utf-8"
| | | Content-Transfer-Encoding: 7bit
| | | X-Newsreader: Microsoft CDO for Windows 2000
| | | Content-Class: urn:content-classes:message
| | | Importance: normal
| | | Priority: normal
| | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | | Path:
| TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| | | Xref: TK2MSFTNGXA01.phx.gbl
| | microsoft.public.dotnet.framework.aspnet:134152
| | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| | |
| | | Okay, I am trying to do is to test the webresource in 2.0
| | |
| | | 1. I created a new project with assembly name (and default
assembly
| name)
| | | "Office".
| | |
| | | 2. I added the following to the AssemblyInfo.cs file (present
under
| the
| | | Properties folder of the project)
| | | [assembly: System.Web.UI.WebResource("Office.test.js",
| | | "application/x-javascript")]
| | |
| | | 3. Now I created a file called test.js on the root folder of the
| project,
| | | having only a single line as:
| | |
| | | alert(2);
| | |
| | | 4. I then marked the test.js file as embedded resource.
| | |
| | | 5. Now in a file called login.aspx (at the root) I added the
| following,
| | |
| | | <script runat="server">
| | | protected void Page_PreRender(object o, EventArgs e)
| | | {
| | | string scriptLocation =
| | | this.Page.ClientScript.GetWebResourceUrl(this.GetT ype(),
| | "Office.test.js");
| | |
| | this.Page.ClientScript.RegisterClientScriptInclude ("TestFunctions",
| | | scriptLocation);
| | | }
| | | </script>
| | |
| | | 6. This produces the web resource on the rendered source as:
| | | <script
| | |
| | >
| >
src="/newoc/WebResource.axd?d=AC-tFcC2LfSlk9Gh_o5X4d1EVF57Jgee8Vh-uzb05tRBlt
| | 7LgDQ-rSE3fGRgtkb60&t=632659511657343750"
| type="text/javascript"></script>
| | |
| | | So far so good, but it is not executing the javascript. To test
| | everything
| | | is okay, I changed the script location (hardcoded) in login.aspx
to:
| | | string scriptLocation = "/newoc/test.js"; // where newoc is my
| virtual
| | | directory.
| | |
| | | Now the alert gets shown when the page is rendered (as it
should). It
| is
| | not
| | | getting it from webresource.
| | |
| | | What I am doing wrong? any pointer will be of great help.
| | |
| | | Thanks
| | |
| | | --
| | | -jojobar
| | |
| | >
| | >
| |
| >
| >
|

Dec 20 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: gregx73 | last post by:
The javascripts created by controls raising postback and validators are loaded through the javascript src="Webresource.axd?src=Webforms.js etc. method. The javascripts are working fine on my...
1
by: Frédéric Mayot | last post by:
Hi, I'm trying to use web resources in ASP.NET 2.0. Unfortunately, it doesn't seem to work for me. Here are the steps I followed : - Create a project WebSite - Add a class library project to...
0
by: Groove | last post by:
(repost!) I have a simple and common scenario. I'm developing pages in VWD and FTP-ing them over to a test servr running Window 2003, NET2 Framework. On my page, I have a DDL that causes a...
1
by: Sergiy Korzh | last post by:
Hello, We have encountered a strange problem with WebResource.axd service. Please check a look at the following two web sites: http://www.easyquerydemo.com and ...
0
by: Steve B. | last post by:
Hi, We have on a production server a very strange bug. After several hours of correct working (from 2hours to 5 hours, randomly), the page output an error : The WebResource.axd handler must...
2
by: =?Utf-8?B?a2NtYXJzaGFsbC5tc3A=?= | last post by:
We're working on an app that will be integrated with another web app through a reverse proxy. Our aspx pages will appear in an IFrame from their site and will appear to the client browser as...
1
by: =?Utf-8?B?TWF5?= | last post by:
We are getting WebForm_DoPostBackWithOptions is not defined and other Java script errors related to WebResource.axd file. I narrowed down the problem and found out the cause but can't come up with...
2
by: zb | last post by:
I have my code directory structured this way App App\Pages <- contains ASPX files App\Pages\Common App\Pages\Common\Controls <- has user controls App\Pages\Common\Controls\SupportingJS <- has...
3
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... We recently upgraded to the blowery.HttpCompress module for .Net 2.0 (I know, long time coming), and I've been investigating some exceptions that have ended up in our log as a result. ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.