473,413 Members | 2,058 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,413 software developers and data experts.

Embedding ASPX pages are resources

Hi,

I have a control that currently embeds it's images and script files as
resources (by marking them as 2.0's WebResourceAttribute) and lets the
runtime handle the streaming of the files to the client.

This control now also uses a html file (which gets used as a "dialog" during
runtime) and I would like to embed this html file as an assembly resource
(just like the above images and scripts) to help make deploying my control's
assembly much easier. Is that possible? How do I go about doing that?

Thanks
Praveen


Mar 16 '06 #1
3 4047
Hi Praveen,

Welcome to the ASPNET newsgroup.

As for the let custom webcontrol display a dialog which pointed to an
embeded htm page in our custom control's assembly, I think it is the same
with embeding other kind of resources. We just need to embed the htm file
in our control's assembly, register with the [assembly:WebResource]
attribute, and then, use hte Page.ClientScript.GetWebResourceUrl method to
get the runtime dynamic url of that embeded htm file. e.g:

[assembly: WebResource("ControLibrary.Resources.dlg.htm", "text/html")]
protected override void RenderContents(HtmlTextWriter output)
{
output.Write("<br/><a href=\"" +
Page.ClientScript.GetWebResourceUrl(this.GetType() ,
"ControLibrary.Resources.dlg.htm") + "\" >New Page</a>");
}

this help output a hyperlink which point to the embeded html page. You can
also use some scripts to display a new dialog window which point to the
embeded html file.

Hope this helps.

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.)

Mar 17 '06 #2
Steven,

Thanks for the response. I actually meant to say that the embedded file is a
ASPX file (not htm file). So, you think it would still work?

Will the asp.net runtime still get a crack at processing the embedded aspx
file link before it gets sent to the client via 2.0 installed http handlers
(for resource retrieval)?

Thanks
-Praveen

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:py**************@TK2MSFTNGXA03.phx.gbl...
Hi Praveen,

Welcome to the ASPNET newsgroup.

As for the let custom webcontrol display a dialog which pointed to an
embeded htm page in our custom control's assembly, I think it is the same
with embeding other kind of resources. We just need to embed the htm file
in our control's assembly, register with the [assembly:WebResource]
attribute, and then, use hte Page.ClientScript.GetWebResourceUrl method to
get the runtime dynamic url of that embeded htm file. e.g:

[assembly: WebResource("ControLibrary.Resources.dlg.htm", "text/html")]
protected override void RenderContents(HtmlTextWriter output)
{
output.Write("<br/><a href=\"" +
Page.ClientScript.GetWebResourceUrl(this.GetType() ,
"ControLibrary.Resources.dlg.htm") + "\" >New Page</a>");
}

this help output a hyperlink which point to the embeded html page. You can
also use some scripts to display a new dialog window which point to the
embeded html file.

Hope this helps.

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.)

Mar 17 '06 #3
Thanks for your response Praveen,

I'm afraid ASPX content won't work for such scenario, the embeded resource
should be static text data since they'll not be processed by the ASP.NET
runtime engine.

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.)

Mar 20 '06 #4

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

Similar topics

8
by: Fabrizio Maltese | last post by:
Hi, I created a project with a page in aspx. How can I put the page in my WebSite, that is not on my server? Do i need a setup project that goes on the Web Server? Thank you, Fabrizio
2
by: Anon-E-Moose | last post by:
Will there ever be a time when we can compile everything (ASPX, VB, Resources, etc) into a DLL? Sometimes the programmer doesn't want the end user to touch ANY files on the server. Compiling...
0
by: William LaMartin | last post by:
I have recently started checking how accessible my web sites are to the Pocket PC using Pocket Internet Explorer (PIE). The main trouble I have discovered is with aspx pages in which I use an...
2
by: Janusz Jezowicz | last post by:
Hello! I would like to have one page on the server, which would be a target processing page for a number of other aspx pages. E.g Processing page \portal_page.aspx Target pages
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
0
by: Mike Dee | last post by:
I'm new to index server and can't get any DocTitle value back from index server (it is returned as null) for all my aspx pages. It do get the values from inside the <title> tags from my static...
3
by: dave | last post by:
I need to add additional .aspx pages to an existing web site. I was hoping to create a new web project in VS 2003, build the project, copy the .aspx files and the .dll into the virtual directory...
2
by: WT | last post by:
Hello, Could we use 'Embedded resources' with resx files that contain text resources used in aspx pages with the syntaxe: Text="<%$ Resources:ResourcesMy,KEY1 %>" I tryed removing the...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.