Sync client side info to server

Discussion in 'ASP .Net' started by Lloyd Sheen, Oct 30, 2007.

  1. Lloyd Sheen

    Lloyd Sheen Guest

    Here are the components:

    Using VS 2005 Pro / ASP.NET / AJAX.NET / VB.NET

    Here is the application:

    I have an app which has a navigator/search facility to find media files
    available to my app and then using the media player ActiveX play them. It
    can get a list of files and using Javascript it can play then as if in a
    playlist. The navigator component is a server side component which
    generates Javascript for buttons which are placed in a repeater. Once the
    list of media files is created and the playing started it is handled solely
    by the Javascript. Using Ajax allow the app to use the navigation component
    to find more files and still have the media player ActiveX play the media
    without interuption.

    What I need to do is the following:

    Since I know the URL for the media file playing I would like to be able to
    navigate back to the currently playing file location (most likely a folder
    on my server) without interupting the media playing. I have an image button
    for this since the naviagation will take place on the server.

    I have tried the following:

    - use a hidden text field to hold the current media playing. This is
    updated by the javascript. When the image button is clicked I access the
    hidden text field but the information that the Javascript placed there is
    not passed (most likely a viewstate issue).

    - use Javascript to do the following:

    <%--<script type="text/javascript">
    function Tester()
    {
    //debugger;
    var playList;
    var argument;
    playList = document.getElementById("ddPlayList");
    if (playList.options.length>0)
    {
    argument = 'RESTORE' + playList.options[0].value;
    __doPostBack('__PlayAllButton', argument);
    }
    }
    </script>
    --%>

    This results in the page refreshing, the media stopping and the playlist
    destroyed.

    I would appreciate any ideas.

    Thanks
    Lloyd Sheen
     
    Lloyd Sheen, Oct 30, 2007
    #1
    1. Advertising

  2. Lloyd Sheen

    Guest

    2 suggestions... Perhaps you could place the code that executes the
    PostBack that you need in an IFRAME so that the refresh won't affect
    the player that's in the main page. This would make your JavaScript a
    little more complicated, but it should work if an IFRAME is an option.

    Secondly, you could use AJAX to pass through JavaScript the current
    directory stored in your hidden field into an ASP.Net page that looks
    up whatever you need through server-side code, and return it to the
    JavaScript that called it.

    Hope that helps.

    Andy

    On Oct 30, 4:20 pm, "Lloyd Sheen" <> wrote:
    > Here are the components:
    >
    > Using VS 2005 Pro / ASP.NET / AJAX.NET / VB.NET
    >
    > Here is the application:
    >
    > I have an app which has a navigator/search facility to find media files
    > available to my app and then using the media player ActiveX play them. It
    > can get a list of files and using Javascript it can play then as if in a
    > playlist. The navigator component is a server side component which
    > generates Javascript for buttons which are placed in a repeater. Once the
    > list of media files is created and the playing started it is handled solely
    > by the Javascript. Using Ajax allow the app to use the navigation component
    > to find more files and still have the media player ActiveX play the media
    > without interuption.
    >
    > What I need to do is the following:
    >
    > Since I know the URL for the media file playing I would like to be able to
    > navigate back to the currently playing file location (most likely a folder
    > on my server) without interupting the media playing. I have an image button
    > for this since the naviagation will take place on the server.
    >
    > I have tried the following:
    >
    > - use a hidden text field to hold the current media playing. This is
    > updated by the javascript. When the image button is clicked I access the
    > hidden text field but the information that the Javascript placed there is
    > not passed (most likely a viewstate issue).
    >
    > - use Javascript to do the following:
    >
    > <%--<script type="text/javascript">
    > function Tester()
    > {
    > //debugger;
    > var playList;
    > var argument;
    > playList = document.getElementById("ddPlayList");
    > if (playList.options.length>0)
    > {
    > argument = 'RESTORE' + playList.options[0].value;
    > __doPostBack('__PlayAllButton', argument);
    > }}
    >
    > </script>
    > --%>
    >
    > This results in the page refreshing, the media stopping and the playlist
    > destroyed.
    >
    > I would appreciate any ideas.
    >
    > Thanks
    > Lloyd Sheen
     
    , Oct 30, 2007
    #2
    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.

Share This Page