zoukankan      html  css  js  c++  java
  • [原创] 一种页面数据错误输入提示方法

     不是很好,但是可以用。用于效验用户输入的数据,给出适当的提示。如整数,日期时间如果用户输入错误,均需要提示用户。

    aspx网页中

     <table cellspacing="0" cellpadding="0" width="100%" border="0" height="10" bgcolor="#FFFFFF">
            <tr>
                <td style="height: 10px">
                    <span id="spanMessage" runat="server"></span>
                </td>
            </tr>
        </table>

    后台代码

    如执行一项操作

     bool ret = Update(entity);
                if (ret == true)
                    spanMessage.InnerHtml = GetTips("Update Project Tracker Successfully");
                else
                    spanMessage.InnerHtml = GetTips("Update Project Tracker Failed");

    GetTips方法如下

    public static  string GetTips(string tips)
            {
                return string.Format("<font color=\'red\'>{0}.</font><br/>", tips);
            }

    OK. 收工。

  • 相关阅读:
    Partition算法及其应用
    [LeetCode 405.] Convert a Number to Hexadecimal
    LeetCode Path Sum 系列
    组合数计算
    (一) go 实现的基于REST的Web服务
    (十)原型模式
    (一)排序
    (九)装饰模式
    (八)适配器模式
    (七)外观模式
  • 原文地址:https://www.cnblogs.com/JamesLi2015/p/1320699.html
Copyright © 2011-2022 走看看