zoukankan      html  css  js  c++  java
  • Element的扩展

    源码如下:

    public Element(string label, string id)
        : this()
    {
        Label = label;
        Id = id;
    }
    
    public Element(string label, string id, string className)
        : this(label, id)
    {
        Class = className;
    }
    
    public Element(string label, string id, bool isrequired, string className)
        : this(label, id, className)
    {
        IsRequired = isrequired;
    }
    
    public Element(string label, string id, bool isrequired, string className, string customValidate)
        : this(label, id, isrequired, className)
    {
        ValidateCustom = customValidate;
    }

    之前写法:

    <input Element="@(_.Create(v => v.Code))" />

    现在需求:当一个页面中有两个一样的Code时,那提交后默认会把两个值保存到一个Code变量中,并用逗号隔开,那如果值中有逗号呢?所以通过上面源码,可以换一种写法,给他不一样的字段名,这样不至于出现前面的问题。

    <input Element="@(new Element("版本名称","Code1"))" />
    <input Element="@(new Element("版本名称","Code2"))" />
  • 相关阅读:
    Tp控制器
    thinkphp总体设计
    视频会议管理系统操作步骤(新)
    视频会议(旧)
    HCIE实验LAB_1(1)
    HCIE实验LAB_1(2)
    HCIE实验LAB_1(3)
    HCIE实验LAB_1(4)
    HCIE实验LAB_1(5)
    HCIE实验LAB_1(6)
  • 原文地址:https://www.cnblogs.com/stickcsharp/p/12484427.html
Copyright © 2011-2022 走看看