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 8336827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:06:56+00:00 2026-06-09T04:06:56+00:00

I’m learning Jquery Mobile. I’m trying to set up the logon page for my

  • 0

I’m learning Jquery Mobile. I’m trying to set up the logon page for my .NET MVC3 site. My controller is just the standard MVC3 account controller.

Here is my Jquery Mobile page:

<html>
<head>
    <title>Mobile Logon</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.css" />

    <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>

<script type="text/javascript">
        $(document).bind("mobileinit", function(){
           $.extend(  $.mobile , {
            ajaxEnabled: false
          });
        });
    </script>

    <script src="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.js"></script>

</head>
<body>

<div data-role="page" data-theme="e">
    <div data-role="header">

        <a href="@Url.Action("Index", "Home")" data-icon="arrow-l" rel="external" >Back</a>
        <h1>Logon</h1>
    </div>

    <div data-role = "content">        
        @Html.ValidationSummary(true, "Login was unsuccessful.")

        @using (Html.BeginForm("Logon", "Account", FormMethod.Post, null))
        {
            <label for="Username">User Name (e-mail address)</label><input type="email" name="Username" />
            <label for="Password">Password</label><input type="password" name="Password" />
            <label><input type="checkbox" name="RememberMe" data-theme="c" />Remember Me</label>
            <button type="submit" value="Log On"></button>
        }
        <center>or</center>

        @using(Html.BeginForm("Register", "Account", FormMethod.Get, null ))
        {
            <button type="submit" value="Register for an account" data-transition="flip"></button>  
        }

    </div>
</div>

When I test the page, if I leave the “Remember Me” box unchecked, then everything works fine. However, if I check the box and click “Log On”, then the controller says that the model is invalid. As I step through the code, I notice that it also thinks that the value for “RememberMe” is false whether the box is checked or not.

Here is the view model for the logon page

public class LogOnModel
{
    [Required]
    [Display(Name = "E-mail address")]
    public string UserName { get; set; }

    [Required]
    [DataType(DataType.Password)]
    [Display(Name = "Password")]
    public string Password { get; set; }

    [Display(Name = "Remember me?")]
    public bool RememberMe { get; set; }
}
  • 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-09T04:06:57+00:00Added an answer on June 9, 2026 at 4:06 am

    You can use your extra mobile attributes when using the HtmlHelpers, an example is below:

    @Html.TextBoxFor(x => x.UserName, new { type = "email" })
    @Html.CheckBoxFor(x => x.RememberMe, new { data_theme = "c" })
    

    MVC 3 converts underscores in attribute names to dashes, so your data-theme attribute remains in-tact. I have just tested this and it works perfectly for your needs.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:

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.