Forum  General Visual ...  How do I...?  Load ASPX embeded page into a AspPageBox in a library project
Previous Previous
 
Next Next
New Post 1/23/2009 10:22 AM
  bzamfir
260 posts
www.zbconsulting.eu
4th Level Poster




Load ASPX embeded page into a AspPageBox in a library project 

Hi,

I have a project that uses an ASPX page (embeding some ASP.NET component), which I need to load into an AspPageBox control

All works ok if I use this in main application project (I have the ASPX page physically in app's root folder, and in AspPageBox I just set

this.Path = "myAspxpage.aspx"

But I want to use that into a library. So the aspx page and AsppageBox are both in the library.

If I set the ASPX page as Content, it is not copied onto main app's  web folder on build.

Also, if I set it to "Copy to output directory" it gets copied to bin, where is of no use

I could set it as Embeded resource, but how to set its URL to the AspPageBox's path property?

Please, any suggestions are welcome.

Thanks


Bogdan Zamfir
Consultant / Developer / Programmer
www.zbconsulting.eu
View Bogdan Zamfir's profile on LinkedIn
 
New Post 1/23/2009 3:56 PM
  palli
14415 posts
1st Level Poster




Re: Load ASPX embeded page into a AspPageBox in a library project 

Hi,

I decided to explore this a little further, as I have had this exact same thoughts in the past.

First let me say, that I took the easy way out in my project at that time :-)  I created a folder for all those "external" files (like your .aspx) page in the control library, and then I just copied it to the application before deploy. You could probably find some build scripts that you can attach to your project that will handle this for you on build, but that will require seperate script for every control library used.

Finally I found a few articles about how to access embedded resources through an URL with the help of  WebResource.axd. This is not any simpe task to accomplish, as it seems, but you can read the article here. This is something that was made available for ASP.NET 2.0 and didn't exist for earlier versions.

I also found a Microsoft article about the same subject which you might take a look at also here.

I didn't explore this further, so I don't have any sample code or anything for you.

Hope this helps,

Palli

 

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 1/23/2009 4:12 PM
  palli
14415 posts
1st Level Poster




Re: Load ASPX embeded page into a AspPageBox in a library project 

Hi again,

If this was a simple resource file, like an image or something like that, then it would be possible to access it as an embedded resource as you can see in a sample code in the code snippet section here.

But I think .aspx pages are no simple resource files, as they need to be interpreted by the web server and then there are the code behind files etc.

I think it would be a good idea to have Gizmox's comments here, if this would be possible.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 1/24/2009 5:22 AM
  bzamfir
260 posts
www.zbconsulting.eu
4th Level Poster




Re: Load ASPX embeded page into a AspPageBox in a library project 

Hi palli,

Thanks for your suggestions.

My thought (my feeling actually) is that I could use a gateway, which will read the aspx from resource file and pass it to the asptextbox Path.

However I have no idea how precisely this could be accomplished, so any suggestion from VWG team will be great.

Regards


Bogdan Zamfir
Consultant / Developer / Programmer
www.zbconsulting.eu
View Bogdan Zamfir's profile on LinkedIn
 
New Post 1/24/2009 8:18 AM
  palli
14415 posts
1st Level Poster




Re: Load ASPX embeded page into a AspPageBox in a library project 

Hi,

I did some testing with using embedded resources within UserControls in another project that is referenced from the main application. I used the info from the article I referenced before and tried with a PictureBox imbedded within the usercontrol from the other library. That worked, just the same way as the example does.

Assigning PictureBox.Image = New AssemblyResourceHandle(Me.GetType(), "WebGUIControlLibrary1.2.GIF") gives me, as viewed in FireFox's FireBug, the address "Assemblies.WebGUIControlLibrary1.2.GIF.wgx?assembly=WebGUIControlLibrary1" for the image source.

Assuming the same for the AspPageBox.Path = New AssemblyResourceHandle(Me.GetType(), "WebGUIControlLibrary1.WebForm1.aspx").ToString() gives me "Assemblies.WebGUIControlLibrary1.WebForm1.aspx.wgx?assembly=WebGUIControlLibrary1"

That, however, in AspPageBox gives an error at runtime, that it is not a valid virtual path.

And yes, we will just wait for Gizmox with further info.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  Load ASPX embeded page into a AspPageBox in a library project
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS