views:

18

answers:

1

Hi, I'm calling a silverlight component in my aspx page like this

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


    <div id="silverlightControlHost" >
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="900">
          <param name="source" value="ClientBin/SilverlightApp4.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="initParams" value="ConfiguredCarId=11" /> 
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="4.0.50401.0" />
          <param name="autoUpgrade" value="true" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50401.0" style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>

</asp:Content>

The parameter works nicely

 <param name="initParams" value="ConfiguredCarId=11" /> 

I would like to modify my page aspx so it takes the parameter itself. Today I'm calling the page

Config.aspx 

and I would like to do something like this call it

Config.aspx?ConfiguredCarId=11

How do I modify the above code to reflect the change? Thanks

A: 

Assuming i understand you correctly (which i'm not 100% sure i do)...

Can you not just do this?

<param name="initParams" value="<%= Request.QueryString["ConfiguredCarId"] %>" />

Or of course if you don't want to rely on the server then you could create a JavaScript function to retrieve the QueryString and make a call to that.

RPM1984
Thanks. I'm new to aspx and didn't expect it to be so simple
bmanu
Nps. I'd recommend jumping over to www.asp.net and watch a few vids. I'm sure you'll find it useful (i did, and still do)
RPM1984