I'm using DataList to show records on Client Site of my web page. I need to show a message when my DataList is empty. Is there a property of Datalist? How to show that message?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Request.PathInfo issues and XSS attacks
- How to dynamically load partial view Via jquery aj
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Add to htmlAttributes for custom ActionLink helper
EmptyDataText
property is not supported by DataList yet. But you can achieve almost same functionality using the following trick:That is creating a Label in Footer of DataList, and make it visible only of DataList record count is 0.
try to use this code
lblMessage
is a label control which initially hidden, beneath the DataList. You can write above code either inOnDataBind
event or just after callingdataList.DataBind()
method.Simply use parameters in C#:
...