hii all.....i have a small problem,act i am trying to retrieve my stored data from database it is retrieving the data properly but the problem is it is showing 0 value for the numeric textboxes which i left empty whlie saving the data.....this is rilly a problem........ kindly help...
retrieving data from database and avoiding nulls
Collapse
X
-
Tags: None
-
-
You could do a manual check that says if it's zero set the display check to "" but the cleaner approach would be to override the default templates this tutorial explains all about them :http://bradwilson.typepad.com/blog/2...templates.html
Your override would be something like
Code:<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Int32>" %> <% string displayText; if (Model == 0) { displayText = ""; } else { displayText = Model.ToString(); } %> <%= Html.TextBox("", displayText)%>Comment
Comment