SWF Viewer question

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

For starters, I know the below is a mixture of C# and ASP.Net. With
that I'm trying to set something up that resembles it though.

if(Request.QueryString["src"].ToString() != "")
{

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://macromedia.com/cabs/swflash.cab#version=4,0,0,0"
id="flaMovie" style="height: 519px; width: 684px;">
<param name="movie" value='<%
=Request.QueryString["src"].ToString()%>' />
<param name="quality" value="medium">
</embed>
</object>

}



The ASP.Net part works, but the object continues to try and load if
there is no querystring provided. Any help would be appreciated.
 
My workaround was to put the viewer in a panel and turn the visibility
off. The control doesn't try to load at that point.
 
For starters, I know the below is a mixture of C# and ASP.Net.  With
that I'm trying to set something up that resembles it though.

if(Request.QueryString["src"].ToString() != "")
{

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://macromedia.com/cabs/swflash.cab#version=4,0,0,0"
    id="flaMovie" style="height: 519px; width: 684px;">
    <param name="movie" value='<%
=Request.QueryString["src"].ToString()%>' />
    <param name="quality" value="medium">
    </embed>
</object>

}

The ASP.Net part works, but the object continues to try and load if
there is no querystring provided.  Any help would be appreciated.

When QueryString["src"] is not provided then it equals to null. So, in
general, you have to check

if(
Request.QueryString["src"] != null &&
Request.QueryString["src"].ToString() != "")
.....

otherwise you would get System.NullReferenceException

Maybe that was a problem in your code.

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top