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>

    }

  • 相关阅读:
    排序(六)插入排序
    集合类 collection接口 ArrayList
    面向对象四大特性
    多线程 interrupt()方法
    NIO Channel 管道
    NIOBuffer 缓冲区
    lamdba表达式
    cloneable以及深拷贝和浅拷贝
    Volatile关键字
    线程池
  • 原文地址:https://www.cnblogs.com/lavenvsxiaoye/p/3577093.html
Copyright © 2011-2022 走看看