SWF Viewer question

Discussion in 'ASP .Net' started by Dave, May 29, 2010.

  1. Dave

    Dave Guest

    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.
     
    Dave, May 29, 2010
    #1
    1. Advertising

  2. Dave

    Dave Guest

    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.




    On May 29, 12:22 pm, Dave <> wrote:
    > 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.
     
    Dave, May 30, 2010
    #2
    1. Advertising

  3. On May 29, 7:22 pm, Dave <> wrote:
    > 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
     
    Alexey Smirnov, May 31, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DzemoT.

    ASP.NET & *.swf(Flash files)

    DzemoT., Jan 12, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    13,687
    Udayakumar
    Jan 13, 2004
  2. Trint Smith
    Replies:
    0
    Views:
    515
    Trint Smith
    Feb 27, 2004
  3. jacksgoogle
    Replies:
    0
    Views:
    1,771
    jacksgoogle
    May 11, 2005
  4. Flynn

    Gallery Viewer viewer script

    Flynn, Feb 22, 2004, in forum: Javascript
    Replies:
    8
    Views:
    252
    John Flynn
    Feb 23, 2004
  5. Replies:
    0
    Views:
    92
Loading...

Share This Page