zoukankan      html  css  js  c++  java
  • Asp.net MVC

    1. 绑定dropdownlist

    @{ IEnumerable<SelectListItem> salutationDdlitems = Model.SalutationDdl.Select(s => new SelectListItem { Text = s.DisplayText, Value = s.Value });}
    @Html.DropDownListFor(s => s.Feedback.PatSalutation, salutationDdlitems, "[None]", new Dictionary<string, object>() { { "style", " 200px;" }, { "id", "patientSal" } })

    2. 添加部分视图,相当于Asp.net 中的UserControl

    @{Html.RenderPartial("_parName");}

    3. ajax form

    @{ using (Ajax.BeginForm("FeedBack", "Feedback", new { buttons = "" }, new AjaxOptions() { HttpMethod = "POST", UpdateTargetId = "FeedbackTabContent", OnBegin = "OnBegin", OnComplete = "PostOnComplete", OnSuccess = "ShowPostSuccess", OnFailure = "ShowPostError" }))

    {

    ….

    }

    4.c# 代码直接输出文本

    @if(a=10)

    {

      @: textcontent

    }

    输出多行文本

    @if(a=10)

    {

      <text>

        content1

        content2

      </text>

    }

  • 相关阅读:
    YAML序列样式
    YAML块标量头
    YAML字符流
    YAML语法字符
    YAML流程
    YAML集合和结构
    YAML缩进和分离
    YAML简介
    Git工作流程
    Git使用前配置
  • 原文地址:https://www.cnblogs.com/lavenvsxiaoye/p/3577093.html
Copyright © 2011-2022 走看看