Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

jquery datepicker + Html.TextBoxFor -


i have question regarding jquerydatepicker , textboxfor() method. have asp.net form in use them create , edit object. use same form editing , creating. looks this:

<script>    $(function () {      $("#datepicker2").datepicker(      {         dateformat: 'yy.mm.dd'      });                            }); </script>  <div class=demo><%= html.textboxfor(m => m.distribution.todate, new { id = "datepicker2", type = "text" })%></div> 

it works fine, question is, how format date when use edit? create it's okay, because display empty textbox , if select date, in correct format. in edit, first displays whole datetime value, , select date, displays 1 way want. how do it, display way want beginning?

i tried so:

<%= html.textboxfor(m => m.distribution.todate.toshortdatestring(), new { id = "datepicker2", type = "text" })%> 

but gives error.

any suggestions?

<script language="javascript" type="text/javascript">    $(document).ready(function () {        $('#startdatepicker').datepicker({ clickinput: true });    }); </script>    <% var attributes = (new dictionary<string, object> { { "value", model.plan.startdate.toshortstrin() } }); %> <% attributes.add("style", "width:80px; text-align:right"); %> <% attributes.add("id", "startdatepicker"); %> <%: html.textboxfor(model => model.plan.startdate, attributes)%> 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -