winform awesomium embedding scripts and images - winforms

I have a winforms application which basically has only an awesomium webcontrol inside (similar to native winfroms webcontrol)
I also have a web application (ASP.net) which contains around 20 javascript files, few stylesheets and images.
The web app is hosted online (cloud server).
My goal is to somehow optimize the winforms loading time (loading the website) by embedding the images, scripts and stylesheets in the winform itselt, and keeping the html and C# code online.
That means, my html pages(online) need to reference the scripts, images and stylesheets from the winform resources.
I know how to embed files in winforms, but i cannot seem to figure out how to reference them in the html.
Much thanks

Related

how to embed a java applet to silverlight application?

I am working on a project where i have to embed a java applet (which contains rtsp streaming) into a silverlight application.
i am new to silverlight.
any idea how to work with that?
Thanks,
To my knowledge this is not possible. You have to embed an applet into an html page (with specific tags like <applet> or <object>). It would be like asking how to embed an applet into a flash application or embed silverlight into an applet. Those are competing technologies with a similiar goal on bringing dynamic content to the enduser.
So what you can do is having a web page with both technologies - some silverlight content and an applet which both gets executed when the page is loaded in the browser...
I mean theoretically you could implement an html page generator in silverlight which generates an html page with an applet in it - but this is complex and I don't see the benefit currently...

Auto fill form in Silverlight OOB

I have a Silverlight Out-of-Browser (OOB) application which has a WebBrowser control inside it. Displayed website in inner web browser comes from the different domain than the application xap file. How could I automatically fill form displayed in the inner browser? Preferably directly with Silverlight, or JavaScript.
I have tried to invoke external JavaScript code from silverlight application:
webBrowser.InvokeScript ("eval", "document.getElementById('formField1').value = 'value1';" +
"document.getElementById('formField2').value = 'value2';"+
"document.forms[0].submit();");
Apparently Silverlight limits this functionality due to the security reasons (Cross-site scripting I think).
WebBrowser.InvokeScript
Executes the specified script, which is defined in the currently loaded HTML.
Since my JS code is not loaded in the HTML that is currently displayed in the web browser control I can't use this approach.
Most obvious solution is to modify target website to contain my JS code. But I would like to hear some other options.

IFrame on Silverllight

I want to add IFrame to my Silverlight web site. and into that iframe i want to add aspx page. is that possible? (aspx page in silverlight.)
It's posible in your HTML where you call the Silverlight xap file, but not inside Silverlight itself
Yes you can add what ever asp / html elements to the web page where your silverlight application is running.
For example modify the ProjectNameTestPage.aspx in your web project.
Actually it is possible to have HTML content nested within the Silverlight, Telerik for example has a control called "HtmlWindow" or "RadWindow" which does just this. Either you could subscribe to their control set or try and find out how they did it.
I have used Telerik's control multiple times in an MEF Silverlight application where different web applications (SSRS for example) are contained with the MEF plugins.

Embed another xaml silverlight object in page

I am totally to Silverlight and am Getting started. I finished the first of the Getting started series here and now seeing into HTML Bridge now over here. Visual Studio created a website for me when it created the new silverlight application. For the HTML bridge tutorial I created another silverlight page(Is this what i should create) and put some code into it.
Question
How do I embed this into a html page? ( I know how to do it using markup as well as javascript, I am confused as to how to get the application out of single xap file inside ClientBin directory)
With Silverlight you are dealing with a single plugin within a HTML page. That plugin is the single XAP file that the HTML page downloads.
Your Silverlight app may also have many pages, but its navigation is not the same as HTML navigation (it uses bookmark URLs to fool the browser into staying on the same page while it changes content). There is only the one HTML page involved.
Initially, just to test your new page, you can change the app.xaml.cs file to create your new Silverlight Page instead of RootVisual = new Main() etc. Long term you need one Silverlight application per separate plugin your require.
Update (from comments):
Pages in Silverlight are changed by substituting a visual element of the single main page with the contents of another Silverlight page.
You cannot simply replace the RootVisual (as that can only be set at startup).
Start with a new Navigation or Business application project to see the basics (navigation adds a lot of complexity, but once you see how it works it is pretty cool).

TestPage.aspx in silverlight

I am a beginner in silverlight. I want to know what is TestPage.aspx and TestPage.html in silverlight. Actually i have google it but din't get enough information. Can any one give me answer??
TestPage.aspx and TestPage.html are the pages which will host your Silverlight content. As you might know, Silverlight is just a project (not a web application) and needs a page that can host it.
These pages are created by default and help you to test your XAML content during your development, which you can later remove from your project.
TestPage.html is dynamically generated by the Silverlight application as part of the Debug process. If you take a look at the Debug tab for the application properties you will see an option to Dynamically generate a test page. If this is selected then you TestPage.html is created in the /Bin/Debug folder of your Silverlight application.
A better solution is to create a web application in the same solution as your Silverlight application then in the properties for the web application go to the Silverlight Applications tab and add your existing Silverlight app to the web project. Also make sure that the Silverlight checkbox is ticked in the Debuggers section of the Web tab of your web application.

Resources