S
ssp
Hi All,
I am trying to add flash movie to a templatecolumn of my datagrid. The
flash movie takes variables to play different sample mp3 tunes. Below
is my HTML Code:
<aspataGrid id=dgTop10 runat="server" Width="100%"
AutoGenerateColumns="False">
<AlternatingItemStyle CssClass="dgAltItems"></AlternatingItemStyle>
<ItemStyle CssClass="dgItems"></ItemStyle>
<HeaderStyle CssClass="dgHeader"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="tArtist"
HeaderText="Artist"></asp:BoundColumn>
<asp:BoundColumn DataField="tSampleName"
HeaderText="Title"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Sample">
<ItemTemplate>
[... This is where I want to add the flash file...]
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="SampleID"
HeaderText="Code"></asp:BoundColumn>
</Columns>
</aspataGrid>
Below Object tag that I want to add:
<object data="common/playsample.swf" width="24" height="17"
style="vertical-align: bottom;" type="application/x-shockwave-flash"
VIEWASTEXT>
<param name="type" value="application/x-shockwave-flash" />
<param name="src" value="common/playsample.swf" />
<param name="data" value="common/playsample.swf" />
<param name="codebase" value="common/playsample.swf" />
<param name="FlashVars" value="sample=test.mp3" /> <!-- The value of
this Parameter is dynamic. It is explained below -->
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="common/playsample.swf" />
<param name="loop" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
</object>
The value of the parameter "FlashVars" above needs to be dynamic and
something like:
<param name="FlashVars" value="'sample='"+<%#
DataBinder.Eval(Container.DataItem, "sampleFileName") %> />
The question is, how do I go about it?
I've tried using Response.Write statement in the HTML code to write the
Object Tag above, but I always get "CS1026: ) expected" error. Below is
the Response.Write code:
<%= Response.Write("<object data=\"common/playsample.swf\" width=\"24\"
height=\"17\" style=\"vertical-align: bottom;\"
type=\"application/x-shockwave-flash\" VIEWASTEXT><param name=\"type\"
value=\"application/x-shockwave-flash\" /><param name=\"src\"
value=\"common/playsample.swf\" /><param name=\"data\"
value=\"common/playsample.swf\" /><param name=\"codebase\"
value=\"common/playsample.swf\" /><param name=\"FlashVars\"
value=\"sample=test.mp3\" /><param name=\"allowScriptAccess\"
value=\"sameDomain\" /><param name=\"movie\"
value=\"common/playsample.swf\" /><param name=\"loop\" value=\"false\"
/><param name=\"quality\" value=\"high\" /><param name=\"wmode\"
value=\"transparent\" /></object>\n"); %>
I hope someone can help me.
SSP
I am trying to add flash movie to a templatecolumn of my datagrid. The
flash movie takes variables to play different sample mp3 tunes. Below
is my HTML Code:
<aspataGrid id=dgTop10 runat="server" Width="100%"
AutoGenerateColumns="False">
<AlternatingItemStyle CssClass="dgAltItems"></AlternatingItemStyle>
<ItemStyle CssClass="dgItems"></ItemStyle>
<HeaderStyle CssClass="dgHeader"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="tArtist"
HeaderText="Artist"></asp:BoundColumn>
<asp:BoundColumn DataField="tSampleName"
HeaderText="Title"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Sample">
<ItemTemplate>
[... This is where I want to add the flash file...]
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="SampleID"
HeaderText="Code"></asp:BoundColumn>
</Columns>
</aspataGrid>
Below Object tag that I want to add:
<object data="common/playsample.swf" width="24" height="17"
style="vertical-align: bottom;" type="application/x-shockwave-flash"
VIEWASTEXT>
<param name="type" value="application/x-shockwave-flash" />
<param name="src" value="common/playsample.swf" />
<param name="data" value="common/playsample.swf" />
<param name="codebase" value="common/playsample.swf" />
<param name="FlashVars" value="sample=test.mp3" /> <!-- The value of
this Parameter is dynamic. It is explained below -->
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="common/playsample.swf" />
<param name="loop" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
</object>
The value of the parameter "FlashVars" above needs to be dynamic and
something like:
<param name="FlashVars" value="'sample='"+<%#
DataBinder.Eval(Container.DataItem, "sampleFileName") %> />
The question is, how do I go about it?
I've tried using Response.Write statement in the HTML code to write the
Object Tag above, but I always get "CS1026: ) expected" error. Below is
the Response.Write code:
<%= Response.Write("<object data=\"common/playsample.swf\" width=\"24\"
height=\"17\" style=\"vertical-align: bottom;\"
type=\"application/x-shockwave-flash\" VIEWASTEXT><param name=\"type\"
value=\"application/x-shockwave-flash\" /><param name=\"src\"
value=\"common/playsample.swf\" /><param name=\"data\"
value=\"common/playsample.swf\" /><param name=\"codebase\"
value=\"common/playsample.swf\" /><param name=\"FlashVars\"
value=\"sample=test.mp3\" /><param name=\"allowScriptAccess\"
value=\"sameDomain\" /><param name=\"movie\"
value=\"common/playsample.swf\" /><param name=\"loop\" value=\"false\"
/><param name=\"quality\" value=\"high\" /><param name=\"wmode\"
value=\"transparent\" /></object>\n"); %>
I hope someone can help me.
SSP