This is a migrated thread and some comments may be shown as answers.

How to set windowless for Silverlight business application

5 Answers 164 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Manoj
Top achievements
Rank 1
Manoj asked on 11 Feb 2012, 03:35 AM

I am using Silverlight business application. At home page using HtmlPlaceHolder. My home page url is as follows.

http://localhost:52878/HTMLPlaceHolderBusinessApplicationTestPage.aspx#/Home

-          How can I set ‘windowless=true’?

I have used following code from your example but not working for me.

if (!Application.Current.Host.Settings.Windowless)

                     {

                           string newUrl;

 

                           newUrl = HtmlPage.Document.DocumentUri.AbsoluteUri.Replace(HtmlPage.Document.DocumentUri.Fragment, string.Empty);

                           newUrl = string.Format("{0}?windowless=true{1}", newUrl, HtmlPage.Document.DocumentUri.Fragment);

 

                           HtmlPage.Window.Navigate(new Uri(newUrl, UriKind.Absolute));

                     }

Output of this code is http://localhost:52878/HTMLPlaceHolderBusinessApplicationTestPage.aspx?windowless=true#/Home

-          Can I open Asp.net page in HTMLPlaceHolder?

-          Can HtmlPlaceholder help in passing parameters to associated ASP.Net page.

5 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 14 Feb 2012, 03:36 PM
Hi Manoj,

 Can I open Asp.net page in HTMLPlaceHolder? 

Yes, you can absolutely use an aspx page as a SourceUrl for RadHtmlPlaceholder.

Can HtmlPlaceholder help in passing parameters to associated ASP.Net page. 

Yes, you can pass parameters to the page which is displayed by RadHtmlPlaceholder. However, you need to make the page aware of parameters. For example, in our QSF the Default.aspx page has the following piece of code which is aware of the windowless parameter:

<div id="silverlightControlHost">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
        width="100%" height="100%">
        <param name="source" value="<%= Examples.Web.Global.Version %>/Examples/QuickStartUI.xap" />
        <param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" />
        <param name="onError" value="onSilverlightError" />
        <param name="background" value="#f2f2f2" />
        <param name="minRuntimeVersion" value="4.0.50826.0" />
        <param name="autoUpgrade" value="true" />
        <param name="EnableRedrawRegions" value="false" />
        <% if (!string.IsNullOrEmpty(Request.QueryString["windowless"]))
           { %>
        <param name="windowless" value="true" />
        <% } %>
        <param name="HtmlAccessEnabled" value="true" />
    </object>
    <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
        border: 0px"></iframe>
</div>

More information on RadHtmlPlaceholder, you can find here.

All the best,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Manoj
Top achievements
Rank 1
answered on 14 Feb 2012, 08:52 PM
Thanks Kiril. It is working for me.
It will be great if you provide few line of code for parameter passing/receiving from silverlight codebehind file to Asp.net page (embedded in HtmlPlaceholder).
0
Kiril Stanoev
Telerik team
answered on 16 Feb 2012, 05:41 PM
Hello Manoj,

Actually the ASPX page within the HtmlPlaceholder should be aware of the URL and process it as it likes. The HtmlPlaceholder should only be setting the URL or it is something else you have in mind?

All the best,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Manoj
Top achievements
Rank 1
answered on 16 Feb 2012, 05:47 PM

I am setting url as follows. In ASPX page load event I want some values from silverlight page.

 

Uri

 

 

uri = new Uri(Application.Current.Host.Source, "../../ReportViewr.aspx");

 

 

 

this.htmlPlaceholder1.SourceUrl = uri;

 

0
Accepted
Kiril Stanoev
Telerik team
answered on 17 Feb 2012, 01:42 PM
Hi Manoj,

 Please take a look at the attached project and let me know if it helps.

Greetings,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
HTMLPlaceHolder
Asked by
Manoj
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or