Note that there are some explanatory texts on larger screens.

plurals
  1. POPage navigation with parameters jQuery Mobile
    primarykey
    data
    text
    <p>I am learning jQuery Mobile right now, but I have a problem. When I am navigating between pages I want to pass some data between this pages. But I can't fix this, this is what I created to test it, but it's not working. I already searched some fora and Google, but can't find an working answer.</p> <p>Do anyone of you know a solution for this?</p> <p>Page 1;</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Test.Master" AutoEventWireup="true" CodeBehind="Page1.aspx.cs" Inherits="Vertegenwoordigers.Page1" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;div data-role="page" id="Page1"&gt; &lt;div data-role="header"&gt; &lt;a id="ToPage2" data-role="button" class="ui-btn-right" data-icon="arrow-r"&gt;Page 2&lt;/a&gt; &lt;h1&gt;Page 1&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; Page 1 &lt;/div&gt; &lt;/div&gt; &lt;/asp:Content&gt; </code></pre> <p>Page 2:</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Test.Master" AutoEventWireup="true" CodeBehind="Page2.aspx.cs" Inherits="Vertegenwoordigers.Page2" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;div data-role="page" id="Page2"&gt; &lt;div data-role="header"&gt; &lt;a id="ToPage1" href="/Page1.aspx" data-role="button" data-icon="arrow-l"&gt;Page 1&lt;/a&gt; &lt;h1&gt;Page 2&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; Page 2 &lt;/div&gt; &lt;/div&gt; &lt;/asp:Content&gt; </code></pre> <p>Javascript:</p> <pre><code>$(document).bind("mobileinit", function () { }); $('#Page1').live('pagebeforecreate', function (event) { console.log("Page1 pagebeforecreate"); console.log(event); }); $('#Page1').live('pagecreate', function (event) { console.log("Page1 pagecreate"); $('#ToPage2').bind('click', function () { console.log("ToPage2 click"); $.mobile.changePage("/Page2.aspx", { type: "post", data: "testdatastring" }); });}); $('#Page2').live('pagebeforecreate', function (event) { console.log("Page2 pagebeforeload"); console.log(event); }); $('#Page2').live('pagecreate', function (event) { console.log("Page2 pagecreate"); console.log(event);}); </code></pre> <p>I hope some of you can help me with this problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload