title: Pass parameter as query string to ajax call of fancybox from asp.net
body: <p>I am working on asp.net web page where i am showing you-tube videos using fancy-box. </p>
  
  <p>So far it is working fine, I also need to make an ajax call to asp.net file <code>UpdateVideoViews.aspx?VideoID=xyzxvtmiw</code>  so that i can update the hits/views for this video in the database (when someone clicks the thumbnail). </p>
  
  <p>So far it is working fine i am able to show videos in fancy box and make an ajax call simultaneously also but problems is that i am not able to pass <code>youtubeVideoID</code> query-string to part of ajax script so that it fetch the youtubeVideoID for the correct video click.</p>
  
  <pre><code>$.ajax({
        type: "POST",
        url: "UpdateVideoViews.aspx?youtubeVideoID=7oR4411Pza0",
       });
  </code></pre>
  
  <p>Below is part of my script</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      //Code to Reinitialize Fancybox script when using update panel START
      var prm = Sys.WebForms.PageRequestManager.getInstance();
      prm.add_initializeRequest(InitializeRequest);
      prm.add_endRequest(EndRequest);
      function InitializeRequest(sender, args) { }
      function EndRequest(sender, args) { InitMyFancyBox(); }
      $(document).ready(function () {
          InitMyFancyBox();
      });
  
      function InitMyFancyBox() {
          $(document).ready(function () {
              $(".youtube").click(function () {
                  // first, get the value from the alt attribute
                  var newTitle = $(this).find("img").attr("alt"); // Get alt from image
                  $.fancybox({
                      'padding': 0,
                      'autoScale': false,
                      'transitionIn': 'none',
                      'transitionOut': 'none',
                      //'title': this.title, // we will replace this line
                      'title': newTitle,  //&lt;--- this will do the trick
                      'width': 680,
                      'height': 495,
                      'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
                      'type': 'swf',
                      'swf': { 'wmode': 'transparent', 'allowfullscreen': 'true' }
                  });
  
                  $.ajax({
                      type: "POST",
                      url: "UpdateVideoViews.aspx?youtubeVideoID=7oR4411Pza0",
                  });
                  return false;
              });
          });
  
      }
  &lt;/script&gt;
  
              &lt;asp:Repeater ID="rptvideos" runat="server" &gt;
                  &lt;ItemTemplate&gt;
                  &lt;div class="single-video-wrapper"&gt;
                      &lt;asp:HyperLink ID="hylnkvideo" CssClass="youtube"  NavigateUrl='&lt;%# getVideoURL(Eval("VideoID"), Eval("VideoYoutubeID")) %&gt;' runat="server"&gt;
                          &lt;div class="video-image-wrapper"&gt;
                              &lt;asp:Image ID="imgvideo" ImageUrl='&lt;%# getVideoImagePath(Eval("VideoYoutubeID"), Eval("VideoYoutubeIcon")) %&gt;'   AlternateText='&lt;%# getVideoTitleDesc(Eval("VideoDate"),Eval("VideoTitle"),Eval("VideoDesc")) %&gt;'  runat="server" CssClass="video-thumbnail" /&gt;
                          &lt;/div&gt;
                         &lt;div class="video-name"&gt;
                              &lt;asp:Label ID="lblvideoName" CssClass="video-name-lbl" runat="server" Text='&lt;%#Eval("VideoTitle") %&gt;'&gt;&lt;/asp:Label&gt;
                         &lt;/div&gt;
                         &lt;div class="video-issue"&gt;
                              &lt;asp:Label ID="lblVideoIssue" CssClass="video-issue-lbl" runat="server" Text='&lt;%#getIssuCode(Eval("IssueCode")) %&gt;'&gt;&lt;/asp:Label&gt;
                         &lt;/div&gt;
                      &lt;/asp:HyperLink&gt;
                  &lt;/div&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>I would appreciate help in this regard</p>