小编Rob*_*Rob的帖子

如何将复选框绑定到mvc3中的viewmodel

我真的很想绕过这个:

我有一个UserModel和一个UserRoleModel:

    public class UserModel
{
    [Required]
    [Display(Name = "User name")]
    public string UserName { get; set; }

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

    [Required]
    [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
    [DataType(DataType.Password)]
    [Display(Name = "Password")]
    public string Password { get; set; }

    [DataType(DataType.Password)]
    [Display(Name = "Confirm password")]
    [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
    public string ConfirmPassword { get; set; …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-3

9
推荐指数
1
解决办法
2万
查看次数

无法完全收缩包裹并使元素居中

我使用以下代码创建一个收缩包装和居中页面.如果浏览器窗口宽于最大潜在宽度,一切都很好.在这种情况下,有三个具有固定宽度的浮动段落.如果窗口足够宽,以便它们都可以浮动在同一条线上,则div将居中并正确包裹.但是当浏览器较窄并且其中一个段落包含到下一行时,div会扩展到窗口的整个宽度,并且不再缩小包装.我已经尝试了所有我能想到的东西,我会放弃并继续前进,除非有人有新想法.奇怪的是,它在ie7中运作良好.去搞清楚.

<!doctype html>

<head>
<style type="text/css">

header, footer, nav, section, article { display: block; }

body
{
    font-size:1em;
    margin:0;
    padding:0;
    font-family: Verdana, Arial, Helvetica, Sans-Serif;
    color:#000;
    background:#ddd url(images/BG.jpg);
}

/*********** Start shrink wrapped and centered layout styles ************************/
#page {
    position:relative;
    overflow:hidden;
}
#container {
    float:left;
    position:relative;
    left:50%;
}
#content 
{

    float:left;
    position:relative;
    right:50%;
}
/*********** End shrink wrapped and centered layout styles ************************/
#content
{
    border:solid 4px #bbb;
}
p
{
    width:20em;
    background-color:red;
    float:left;
}
</style>
<body>
<div id="page"> …
Run Code Online (Sandbox Code Playgroud)

css html5 css3

5
推荐指数
1
解决办法
455
查看次数

为什么我的Joomla 2.5插件不起作用?

我已经使用以下代码在Joomla 2.5中创建并成功安装了一个插件

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

class plgCustomFunctions extends JPlugin 
{
    public function onContentPrepare($context, &$article, &$params, $page = 0)
    {
        $article->title = "Something!";
        return true;
    }
}?> 
Run Code Online (Sandbox Code Playgroud)

我的理解是,这应该覆盖每篇文章的标题.那没有发生.我错过了什么?

joomla2.5

1
推荐指数
1
解决办法
978
查看次数

标签 统计

asp.net-mvc-3 ×1

css ×1

css3 ×1

html5 ×1

joomla2.5 ×1