javascript

java

python

c#

android

node.js

c++

reactjs

php

html

jquery

css

.net

ios

git

ruby-on-rails

sql

c

string

ruby

數據注釋-ASP.Net MVC DisplayForm

在我的模型中,我的其中一個屬性具有以下DataAnnotations

[Required(ErrorMessage = "*")]
[DisplayFormat(DataFormatString = "{0:d}")]
[DataType(DataType.Date)]
public DateTime Birthdate { get; set; }

所需的注釋效果很好,我添加了其他兩個以節省時間。 它使用以下方式綁定到視圖中的輸入

<%=Html.TextBoxFor(m => m.Birthdate, new { @class = "middle-input" })%>

但是,無論何時加載視圖,我仍然會在輸入框中顯示時間。 無論如何,有使用DataAnnotations刪除它嗎?

trans by 2020-02-22T07:14:16Z

html-CSS Grid Layout在IE11中不起作用,即使帶有前綴

我正在為網格使用以下HTML標記。

<section class="grid">
    <article class="grid-item width-2x height-2x">....</article>
    <article class="grid-item">....</article>
    <article class="grid-item">....</article>
    <article class="grid-item width-2x">....</article>
    <article class="grid-item height-2x">....</article>
    <article class="grid-item">....</article>
    <article class="grid-item">....</article>
    <article class="grid-item width-2x height-2x">....</article>
</section>

SCSS代碼如下所示:

.grid {
    display: grid;
    grid-template-columns: repeat( 4, 1fr );
    grid-gap: 30px;
    align-items: start;
    .grid-item {
        &.height-2x {
            grid-row: span 2;
        }
        &.width-2x {
            grid-column: span 2;
        }
    }
}

由于我在工作流程中使用自動前綴,因此會自動添加所有相關屬性,并添加<section class="grid"> <article class="grid-item width-2x height-2x">....</article> <article class="grid-item">....</article> <article class="grid-item">....</article> <article class="grid-item width-2x">....</article> <article class="grid-item height-2x">....</article> <article class="grid-item">....</article> <article class="grid-item">....</article> <article class="grid-item width-2x height-2x">....</article> </section>前綴。 我可以通過檢查元素確認。

現在,問題是此代碼在Chrome,Firefox和Opera中運行正常,但是當我在Microsoft Edge或IE 11中打開此頁面時,所有網格項在第一個單元格處都相互重疊。 根據此站點,這些瀏覽器支持帶有<section class="grid"> <article class="grid-item width-2x height-2x">....</article> <article class="grid-item">....</article> <article class="grid-item">....</article> <article class="grid-item width-2x">....</article> <article class="grid-item height-2x">....</article> <article class="grid-item">....</article> <article class="grid-item">....</article> <article class="grid-item width-2x height-2x">....</article> </section>前綴的CSS網格布局。 我已經為這種情況創建了一個CodePen。

CodePen鏈接

為什么不起作用?

<section class="grid">
  <article class="grid-item width-2x height-2x">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item width-2x">....</article>
  <article class="grid-item height-2x">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item width-2x height-2x">....</article>
</section>
<section class="grid">
  <article class="grid-item width-2x height-2x">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item width-2x">....</article>
  <article class="grid-item height-2x">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item">....</article>
  <article class="grid-item width-2x height-2x">....</article>
</section>

trans by 2020-02-22T07:09:06Z

返回原始json(字符串)在

我想構建自己的JSON可以领救济金的游戏,并讓服務返回一個字符串,這是代碼

[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
public string GetCurrentCart()
{
     

Navigation