WebFrom页面绑定数据过于冗长的处理方法

嘛 这个是当时写完东西之后 功能没什么问题 但是由于页面绑定的数据太长 破坏了整体的样式(对于本人来说 样式就是浮云....)

所以测试就跟我说必须弄好看点 于是乎  我就找到了下面这种方法

因为我这边页面后天cs代码里面已经写好了一个对象前台直接obj.属性绑定就好了

<tr>
     <td class="bg-gray">概要:</td>
     <td colspan="3">
     <%if (CollegeModel.Introduction.Length>500)
      {%>
       <%=CollegeModel.Introduction.Substring(0, 500).GetDefaultStrFromString()%> 
       <%}
      else{%>
         <%=CollegeModel.Introduction.GetDefaultStrFromString() %> 
       <%} %>
       </td>
</tr>

这样就限制了字段说明太长 而导致页面样式变丑的“事故”  23333

原文地址:https://www.cnblogs.com/CurtilageBoy/p/9227939.html