Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8744119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:47:43+00:00 2026-06-13T11:47:43+00:00

I am using a razor template so I can reduce the amount of clutter

  • 0

I am using a razor template so I can reduce the amount of clutter in my mvc views when working on code. I have created “section” which will render as the seperate pages required for my mobile pages as follows:

<div data-role="page" id="page2">
<div data-role="header">
    @if (IsSectionDefined("Header2"))
    {
        @RenderSection("Header2")
    }
    else
    {
    }
</div>
<div data-role="content">
    @if (IsSectionDefined("Content2"))
    {
        @RenderSection("Content2")
    }
    else
    {
    }
</div>
<div data-role="footer">
    @if (IsSectionDefined("Footer2"))
    {
        @RenderSection("Footer2")
    }
    else
    {
    }
</div>

I use the same template as above for up to 3 pages.

My issue at the moment is I have assigned some code to my page 2 using:

@section Content2{
<div id="machinesearch" class="ui-content">
    <ul id="machinelist" data-autodividers="true" data-theme="d" data-divider-theme="a"
        data-filter="true" data-role="listview">
        @foreach (var item in Model.Plants)
        {
            <li><a href="#page1" onclick="javscript:MachineSet($(this).find('input').val(),$(this).text());">@item.Asset_Descriptor<input id="Sap_ID" type="hidden" value="@item.Asset_SAP_ID"/></a></li>      
        }
    </ul>
</div>

}

And my link to show this page is:

$("#testbutton").click(function(){

$('#page2').trigger('pagecreate');
$("#machinelist").listview('refresh');
alert("test");

});

But this does not seem to make any difference.

Any ideas?

I can see the data is all loaded in correctly when I view the html source of my first page which also contains the html for the second page. It seems to be because razor is injecting the data in to page 2 after the page 1 is loaded.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:47:44+00:00Added an answer on June 13, 2026 at 11:47 am

    You aren’t actually showing the page…..

    $.mobile.changePage("#page2");
    

    will show the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an ASP.Net MVC 3 Web application using Razor Views. I have
I have this code in mvc 3 razor @using (Html.BeginForm(MyAction, MyController)) { <input type=text
I am working on an MVC3 application using the Razor syntax and I have
I started the site using AST.NET Razor template, not ASP.NET MVC template. I recall
I have a telerik mvc grid in a Razor view. I am using custom
I'm using MVC for REST so that I can take advantage of Razor for
I am facing an issue while loading the Page created using Razor Template using
I am using razor template and following is the scenario $(function(){ //if (ViewBag.IsCallFunction){ somefunction();
I am using Razor syntax in an ASP.NET MVC3 View inside a JavaScript code
I have developed a website using Razor (Microsoft WebMatrix) and now I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.