RobM_01 0 Newbie Poster

Hi, I need some help please I'm trying to display a variable on a page but cant quite get it to work.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MyProfile : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e) {

        
        string GalleryLink = Profile.GalleryLink;

    }
}




<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyProfile.aspx.cs" Inherits="MyProfile" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>My Profile Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="~/Login.aspx" />
        <br />
        <br />
        <asp:LoginName ID="LoginName1" runat="server" />
        <br />
        <br />
        <% Response.Write(GalleryLink);%>
    </div>
    </form>
</body>
</html>

Once I have this tested to prove the right info is displayed I then need to add the variable to some javascript using something like <%= GalleryLink %> as shown below.

<!-- START EMBED CODE -->

    <script type="text/javascript" src="http://imagerealm.slideshowpro.com/m/embed.js"></script>

    <center>
        <div id="M_Gallery">
        </div>
    </center>

    <script type="text/javascript">
        SlideShowPro({
            attributes: {
                id: "M_Gallery",
                width: 600,
                height: 600
            },
            mobile: {
                auto: false
            },
            params: {
                bgcolor: "#000000",
                allowfullscreen: true
            },
            flashvars: {
            xmlFilePath: "<%= GalleryLink %>",
                paramXMLPath: "http://mysite.slideshowpro.com/m/params/mist.xml",
                displayMode: "Manual",
                startup: "Open Gallery",
                videoAutoStart: "Off",
                feedbackPreloaderAppearance: "Bar"
            }
        });
    </script>

    <!-- END EMBED CODE -->

many thanks

Rob.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.