title: jquery mobile needs a refresh to work properly
body: <p>I wrote two pages using master page in .net and JQM. But when I redirect to second page, JQM swipe control does not works without a refresh. Besides, any control or function like a simple alert() does not work. I am sharing my code:</p>
  
  <p>Master Page:</p>
  
  <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="UserMaster.master.cs" Inherits="Password.Masters.UserMaster" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"&gt;&lt;/script&gt;
  
       &lt;script type="text/javascript"&gt;
           $(document).on("pageinit", "#demo-page", function () {
               $(document).on("swipeleft swiperight", "#demo-page", function (e) {
                   if ($.mobile.activePage.jqmData("panel") !== "open") {
                       if (e.type === "swiperight") {
                           $("#left-panel").panel("open");
                       }
                   }
               });
           });
       &lt;/script&gt;
  
      &lt;asp:ContentPlaceHolder ID="head" runat="server"&gt;
      &lt;/asp:ContentPlaceHolder&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div data-role="page" id="demo-page" data-theme="d"&gt;
          &lt;div data-role="header" data-theme="b" class="ui-header ui-bar-b" role="banner"&gt;
              &lt;h1&gt;Web Page&lt;/h1&gt;
              &lt;a href="#left-panel" data-theme="d" data-icon="arrow-r" data-iconpos="notext" data-shadow="false" data-iconshadow="false" class="ui-icon-nodisc"&gt;Open left panel&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div data-role="panel" id="left-panel" data-theme="b"&gt;
              &lt;!----&gt;
              &lt;ul data-role="listview" data-theme="d"&gt;
                  &lt;li data-icon="arrow-r" data-theme="b"&gt;Welcome
                      &lt;asp:LoginName ID="LoginName1" runat="server" /&gt;
                  &lt;/li&gt;
                  &lt;li data-icon="home"&gt;&lt;a href="../Pages/Home.aspx" data-rel=""&gt;Homepage&lt;/a&gt;&lt;/li&gt;                
  
              &lt;/ul&gt;
          &lt;/div&gt;
  
          &lt;div  data-role="content"&gt;
          &lt;form id="form1" runat="server"&gt;
              &lt;div&gt;
                  &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&gt;
                  &lt;/asp:ContentPlaceHolder&gt;
              &lt;/div&gt;
          &lt;/form&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Slide.aspx (it is an empty page):</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Masters/UserMaster.Master" AutoEventWireup="true" CodeBehind="Slide.aspx.cs" Inherits="Password.Pages.Slide" %&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
      &lt;script type="text/javascript"&gt;
  
       &lt;/script&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Home.aspx (also this is an empty page):</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Masters/UserMaster.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="Password.Pages.Home" %&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
      &lt;script type="text/javascript"&gt;
  
       &lt;/script&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I want to use the swipe control in every page using master page but when I go to Home.aspx  from Slide.aspx by using left swipe panel, swipe control does not works. When I refresh the page, then it works. It is the same for a button control (for example). How can I make it work? Is the problem about "pageinit"? What about document.ready()? I had tried all possible solutions but failed. Thanks.</p>