473,396 Members | 1,693 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,396 software developers and data experts.

Embed Resource. I can't figure this out.

Hello,

I have an assembly with customs controls, classes and handlers.I am
creating it as an ASP.NET 2.0 VS2005 Web Project

This one one of my handlers:

Namespace Web

Public Class SiteMap : Implements IHttpHandler

Public Sub ProcessRequest(ByVal context As HttpContext)
Implements IHttpHandler.ProcessRequest

Dim xslDoc As XslCompiledTransform = New XslCompiledTransform
xslDoc.Load(Page.ClientScript.GetWebResourceUrl(Me .GetType,
"MyProjectNamespace.Web.SiteMap.xsl")) >>ERROR

End Sub
...

I get the error "Page is not declared".

I also have the code line "<Assembly:
System.Web.UI.WebResource("MyProjectNamespace.Web. SiteMap.xsl",
"text/xml")" in my AssemblyInfo.vb file.

And I set the Build Action of "SiteMap.xsl" to "Embedded Resource".

I have been reading documentation in internet but I can't find the
solution.

Could someone help me out?

Thank You,

Miguel

Nov 19 '06 #1
2 1633
See my reply:
http://forums.asp.net/thread/1470322.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"shapper" <md*****@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hello,

I have an assembly with customs controls, classes and handlers.I am
creating it as an ASP.NET 2.0 VS2005 Web Project

This one one of my handlers:

Namespace Web

Public Class SiteMap : Implements IHttpHandler

Public Sub ProcessRequest(ByVal context As HttpContext)
Implements IHttpHandler.ProcessRequest

Dim xslDoc As XslCompiledTransform = New XslCompiledTransform
xslDoc.Load(Page.ClientScript.GetWebResourceUrl(Me .GetType,
"MyProjectNamespace.Web.SiteMap.xsl")) >>ERROR

End Sub
...

I get the error "Page is not declared".

I also have the code line "<Assembly:
System.Web.UI.WebResource("MyProjectNamespace.Web. SiteMap.xsl",
"text/xml")" in my AssemblyInfo.vb file.

And I set the Build Action of "SiteMap.xsl" to "Embedded Resource".

I have been reading documentation in internet but I can't find the
solution.

Could someone help me out?

Thank You,

Miguel

Nov 19 '06 #2
Hi,

I followed your example and I get an error:

Value cannot be null.
Parameter name: stylesheet

Maybe I am using this wrong?

My project namespace is: MyNM

I am using my resource file in:

----------------------
Namespace Web

Public Class SiteMap : Implements IHttpHandler

Public Sub ProcessRequest(ByVal context As HttpContext)
Implements IHttpHandler.ProcessRequest

Dim a As System.Reflection.Assembly = Me.GetType().Assembly
Dim s As Stream =
a.GetManifestResourceStream("MyNM.Web.SiteMap.xsl" )
----------------------

My SiteMap.xsl is in a folder inside my project named "Assets/Web/"

In my AssemblyInfo.vb I have:

<Assembly: System.Web.UI.WebResource("MyNM.Web.SiteMap.xsl",
"text/xml")>

Am I doing something wrong?

Thanks,

Miguel

Teemu Keiski wrote:
See my reply:
http://forums.asp.net/thread/1470322.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"shapper" <md*****@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hello,

I have an assembly with customs controls, classes and handlers.I am
creating it as an ASP.NET 2.0 VS2005 Web Project

This one one of my handlers:

Namespace Web

Public Class SiteMap : Implements IHttpHandler

Public Sub ProcessRequest(ByVal context As HttpContext)
Implements IHttpHandler.ProcessRequest

Dim xslDoc As XslCompiledTransform = New XslCompiledTransform
xslDoc.Load(Page.ClientScript.GetWebResourceUrl(Me .GetType,
"MyProjectNamespace.Web.SiteMap.xsl")) >>ERROR

End Sub
...

I get the error "Page is not declared".

I also have the code line "<Assembly:
System.Web.UI.WebResource("MyProjectNamespace.Web. SiteMap.xsl",
"text/xml")" in my AssemblyInfo.vb file.

And I set the Build Action of "SiteMap.xsl" to "Embedded Resource".

I have been reading documentation in internet but I can't find the
solution.

Could someone help me out?

Thank You,

Miguel
Nov 19 '06 #3

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

Similar topics

11
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after...
3
by: M | last post by:
Hi Folks, Does anyone know how to embed a file into a resource in C#? You seem to be able to embed Icon, Bitmap, Cursor's & Strings. But how do you embed a file??? In VC++ version 6 you...
7
by: axis | last post by:
What I want to do is pretty simple: I have a bunch of icons in my application project (visual studio .net 2003), and I want to embed those in the executable, and access them through code. I've...
2
by: David | last post by:
Hello, I'm using an xml schema (xsd file) to validate input xml. This xsd is used by the C# dll and must be distributed with it. The xsd isn't modified. So I would like to embed it in the DLL so...
0
by: scott.mankowitz | last post by:
Hi! Does anyone know if there is an easy way to embed fonts into a vb2005 application? Ideally, I would like to add the .ttf files as resources and just set the font using the forms designer. I...
0
by: John | last post by:
Hi This is my question: I have an Exe and a .resource that i modify with Lutz Resourcer. I can't manage to embed the modified resource file in the exe with al.exe. al.exe myexe.exe...
8
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info...
8
by: Tomasz J | last post by:
Hello Developers, It may sound like a stupid question, but how to embed a resource in ASP.Net 2.0 web application? I mean, without using a separate library. There is no "build action" property....
0
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.