<script type="text/javascript">
var a = @ViewBag.User.Birthday.ToString();
//....
</script>
But the error:
SyntaxError:
missing; before statement
var a = 1905/2/5 0:00:00;
------ Solution ------------------------------------ --------
var a = "@ViewBag.User.Birthday.ToString();"
------ Solution -------------------------- ------------------
assume the background setting
ViewBag.Message=null;
Front judgment
<input class="text" id="Tel" value="@(ViewBag.Message == null ? "为空时显示值" : ViewBag.Message)"/>
------ Solution ------------------------------------- -------
<input type="text" id="Tel" value="@(ViewBag.User.Tel??"为空时的值")"/>
------ For reference only ------------------------- --------------
wood anybody here ?
------ For reference only -------------------------------------- -
var a = "@ViewBag.User.Birthday.ToString()";
enclose a little more
------ For reference only ---------------------------------------
Why do not you turn a good background , directly to the front desk it ?
------ For reference only -------------------------------------- -
just turn the code is being written back , huh, huh , thank you ah
------ For reference only --------------------- ------------------
embarrassed , ask
<input class="text" id="Tel" value="@ViewBag.User.Tel"/>
@ ViewBag.User.Tel judge me how it is not empty ?
没有评论:
发表评论