Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 693237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:43:59+00:00 2026-05-14T02:43:59+00:00

I have a Silverlight app that has to load an image dynamically, depending on

  • 0

I have a Silverlight app that has to load an image dynamically, depending on the image name. The approach that im taking right now is passing the image name by query string to the page and passing that as a param to the Silverlight objet tag

This is the query string passed

Response.Redirect("Build.aspx?img=" + this.PictureUploader.PostedFile.FileName;

And I try to pass it to Silverlight like this:

<object id="SilverlightObject" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="Silverlight/iMapsSL.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="3.0.40624.0" />
      <param name="autoUpgrade" value="true" />
      <param name="image" value="<%# Request.QueryString["img"] %>" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
          <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>
    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>

in the last param tag with name=image value= Requerst.QueryString

I catch the image inside the Silverlight app like this

private void Application_Startup(object sender, StartupEventArgs e)
    {
        string pictureName = "";

        if (e.InitParams != null && e.InitParams.Count > 0)
        {
            pictureName = e.InitParams["image"];

            this.RootVisual = new MainPage(pictureName);
        }

        else
        {
            this.RootVisual = new MainPage();
        }
    }

And when MainPage starts, I set the image source of the Image control like this

this.Image.Source = new BitmapImage(new Uri(pictureName, UriKind.RelativeOrAbsolute));

But Silverlight loads without an image, any help someone?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:43:59+00:00Added an answer on May 14, 2026 at 2:43 am

    You can’t set arbitary values to by inventing a param names like “image”. InitParams are created by specifying the “initparams” param. The “initparams” value is a comma delimited set of name=value pairs. Hence your code should look like:-

    <object id="SilverlightObject" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="Silverlight/iMapsSL.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="3.0.40624.0" />
          <param name="autoUpgrade" value="true" />
          <param name="initparams" value="image=<%# Request.QueryString["img"] %>" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight app that has a bunch of styles that are referenced
For example: First, say I have a Silverlight app with Windowless=true so that I
I have built a WCF Service that is being consumed by a Silverlight app.
I have a Silverlight app that needs low-level socket support. It's an Out-of-Browser Trusted
I have a Silverlight app that is using the MVVM pattern. I have a
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I have to build small (for now) admin app in Silverlight2, and would like
I have a silverlight 2 beta 2 application that accesses a WCF web service.
I have a Silverlight 2 application that is consuming a WCF service. As such,
We have a Silverlight 2 project (game) that will require a lot of character

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.