2
Contributors
9
Replies
11
Views
4 Years
Discussion Span
Last Post by gahhon
0

Can you explain what you mean? Do you want to add an image, or do you want to add a .xap (Silverlight file) displaying an image?

0

hmm..
i think is to add the .xap to display an image...
is it must to add the.xap to display an image in .aspx?

0

what if i want to use silverlight to insert image into my .aspx page?
assignment required.

0

You need to create a Silverlight project in Visual Studio and go from there (or use Blend). When you are done, embed the xap file in your aspx page.

0

I've tried it..

this is my Payment.aspx

<head runat="server">
    <script src="Silverlight.js" type="text/javascript"></script> 

    <title>Payment</title>
    <script language="jscript" type="text/jscript">
         createSilverlightPlugin('paymentSilverlightPluginHost', '400', '1000', 'PaymentHeader.xaml')
    </script>
    <script type="text/javascript">
        function createSilverlightPlugin(placeHolder, width, height, xamlfile) {
            var parentElement = document.getElementById(placeHolder);
            Silverlight.createObject
            (
                xamlfile,
                parentElement,
                placeHolder,
                {
                    width: width,

                    height: height,

                    inplaceInstallPrompt: false,


                    isWindowless: 'false',

                    framerate: '24',
                    version: '1.0'
                },
                {
                    onError: null,
                    onLoad: null
                },
                null
            );
        }
    </script>
</head>
<body>
    <form id="frmPayment" runat="server">
        <div id="paymentSilverlightPluginHost">
            <asp:Image ID="imgPaymentHeader" runat="server"/>
        </div>

and this is my .xaml code

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"
        xmlns:local="clr-namespace:Olympia_Open_College">
    <Image Canvas.Left="47" Canvas.Top="89" Height="150" Stretch="Fill" Width="200" Source="/Images/PaymentHeader.png"></Image>
</Canvas>

and the problem was occured about the .xaml code..
the Source is not part of the project..... and so on..
and when i execute it...
a JScript runtime error: Obejct Expected and highlighted
createSilverlightPlugin('paymentSilverlightPluginHost', '400', '1000', 'PaymentHeader.xaml')

can i what is it problem? how do i solve it?s

0

if is you what would you suggest me to do with it? by using silverlight insert a image into the .aspx page.

0

now i solved the problem already, by using .xap file..
but i got a doubt can i create 2nd .xap file and embed it with another .aspx page?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.