How to set windowless for Silverlight business application

6 posts, 2 answers
  1. Manoj
    Manoj avatar
    43 posts
    Member since:
    Aug 2011

    Posted 10 Feb 2012 Link to this post

    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.

  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 14 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Manoj
    Manoj avatar
    43 posts
    Member since:
    Aug 2011

    Posted 14 Feb 2012 Link to this post

    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).
  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 16 Feb 2012 Link to this post

    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 >>
  6. Manoj
    Manoj avatar
    43 posts
    Member since:
    Aug 2011

    Posted 16 Feb 2012 Link to this post

    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;

     

  7. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 17 Feb 2012 Link to this post

    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 >>
Back to Top
DevCraft banner