c# - standard textbox doesn't get default DateTime value -


i'm building mvc c# application , can't seem find solution this. i'm guessing it's silly. it's bit of simplified example i'm telling right now, it's accurate. have modelled view, @model xxx.store , in there show table of items, fruit models. each table entry has expire date. use jquery's datepicker ui friendly datepicking, have trouble setting default value in textbox existing value. know data gets saved, see in database, doesn't show on web page.

@foreach(var item in ...)     ...     <input type="text" onchange="updateexpiredate(this.value, @item.loginid);"                         class="datepick" value="@item.expiredate.tostring()" />       ... 

so value part, doesn't work. i've thought using html.textboxfor(...) points central modal, store class, i'm not using in table.

also might important note, expiredate value nullable. no exceptions thrown in visual studio or chrome's dev tools

try html.textbox

@html.textbox("txtname", "mairaj ahmed  ", new {class="datepick",onchange="updateexpiredate(this.value, @item.loginid);" }); 

here "mairaj ahmed" value of textbox can change model property. , attributes added new keyword separated comma.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -