How to pass a database value from asp.net to a javascript function (slideshowpro)? -
i have web pages containing slideshows powered javascript, , database connections powered asp.net. slideshows run flash files, urls stored in database.
a static page have in headscript:
> <script type="text/javascript"> var expressinstallswfurl = {}; var > flashvars = {}; var params = {}; var attributes = {}; > swfobject.embedswf("/_flash/2909.swf", "slideshowdisplay", "575", > "300", "9.0.0", expressinstallswfurl, flashvars, { wmode: > "transparent" }, attributes); </script>
... /_flash/2909.swf url of flash file static page, , "slideshowdisplay" target div.
now need call flash file dynamically, eg replacing static 2909 <%# eval("myflashfileurl") %> filename datasource. fails: swfobject.embedswf(<%# eval("myflashfileurl") %>, ....
my javascript sucks , i'm beginner asp (i speak vb, no c#), i'd appreciate solution that's pretty exact , complete i'm bound syntaxes wrong.
huge thanks.
without code view speculation. once make decision make things dynamic, introduce asp control gridview contains rows of data among link static page dynamic file names passed parameters.
so code this:
<script type="text/javascript"> var expressinstallswfurl = {}; var flashvars = {}; var params = {}; var attributes = {}; swfobject.embedswf('<%=request("flashfile")%>', "slideshowdisplay", "575", "300", "9.0.0", expressinstallswfurl, flashvars, { wmode: "transparent" }, attributes); </script>
where "flashfile"
parameter page
and continue example gridview have (this snippet):
<asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" datasourceid="sqldatasource1" > <columns> <asp:templatefield> <itemtemplate> <a href='your_static_page.aspx?flashfile=<%= eval("myflashfileurl")%>' </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
mind, there many ways implement dynamic solution, overlay utility modal or colorbox allow bypass call secondary page entirely. depends on project requirements.
hope gets going in right direction.
Comments
Post a Comment