Connecting Tech Pros Worldwide Help | Site Map

Embedding ASPX pages are resources

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 16th, 2006, 08:05 PM
Praveen
Guest
 
Posts: n/a
Default 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





  #2  
Old March 17th, 2006, 04:35 AM
Steven Cheng[MSFT]
Guest
 
Posts: n/a
Default RE: Embedding ASPX pages are resources

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

  #3  
Old March 17th, 2006, 03:35 PM
Praveen
Guest
 
Posts: n/a
Default Re: Embedding ASPX pages are resources

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]" <stcheng@online.microsoft.com> wrote in message
news:pyW1UJYSGHA.7144@TK2MSFTNGXA03.phx.gbl...[color=blue]
> 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.)
>[/color]


  #4  
Old March 20th, 2006, 02:46 AM
Steven Cheng[MSFT]
Guest
 
Posts: n/a
Default Re: Embedding ASPX pages are resources

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



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.