473,857 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 WebResourceAttr ibute) 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 4098
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:WebRes ource]
attribute, and then, use hte Page.ClientScri pt.GetWebResour ceUrl method to
get the runtime dynamic url of that embeded htm file. e.g:

[assembly: WebResource("Co ntroLibrary.Res ources.dlg.htm" , "text/html")]
protected override void RenderContents( HtmlTextWriter output)
{
output.Write("< br/><a href=\"" +
Page.ClientScri pt.GetWebResour ceUrl(this.GetT ype(),
"ControLibrary. Resources.dlg.h tm") + "\" >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******** ******@TK2MSFTN GXA03.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:WebRes ource]
attribute, and then, use hte Page.ClientScri pt.GetWebResour ceUrl method to
get the runtime dynamic url of that embeded htm file. e.g:

[assembly: WebResource("Co ntroLibrary.Res ources.dlg.htm" , "text/html")]
protected override void RenderContents( HtmlTextWriter output)
{
output.Write("< br/><a href=\"" +
Page.ClientScri pt.GetWebResour ceUrl(this.GetT ype(),
"ControLibrary. Resources.dlg.h tm") + "\" >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
1722
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
4119
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 everything would make deployment a snap...
0
1280
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 iframe having as source a htm page or another aspx page. PIE does not render iframes, so those embedded pages do not display. Is there a method, not using iframes, that will allow you to embed one aspx page within another aspx page? (I can work...
2
2185
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
2990
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 updated this system and changed the pages that are saved to the server as aspx - everything works fine and pages can be served - but Its not impossible for a single client to request 100 plus pages in one session - as each page is requested it is...
29
3689
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 id="Form1" method="post" runat="server"> <%
0
1059
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 .htm pages just fine. My aspx pages however are generated from master pages where the title tag is set dynamically at run-time. So, it seens like index server is just indexing my raw .aspx and .cs.aspx pages instead of actually running the page...
3
1913
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 of the existing web site. The existing web site would have a page with a link to the new web pages. I am getting the error of "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This...
2
10761
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 App_GlobalResources folder, and after verifying thta my resources were correctly embedded in my dll, I get errors as if asp.net was
0
9768
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11083
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10808
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10394
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7940
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5774
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5971
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4191
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.