{"id":257,"date":"2014-08-29T12:56:37","date_gmt":"2014-08-29T12:56:37","guid":{"rendered":"http:\/\/mairwa.com\/wordpress\/?p=257"},"modified":"2014-08-29T12:56:37","modified_gmt":"2014-08-29T12:56:37","slug":"updated-questions-in-net-topic","status":"publish","type":"post","link":"http:\/\/mairwa.com\/wordpress\/?p=257","title":{"rendered":"updated questions in .Net topic"},"content":{"rendered":"<p><b>&#8212; <a href=\"http:\/\/stackoverflow.com\/questions\/8599639\/how-can-i-check-if-my-model-is-valid-from-inside-the-razor-view\">Check if my model is valid from inside the razor view?<\/a><\/b><\/p>\n<p>Gets the model state dictionary object that contains the state of the model and of model-binding validation.<\/p>\n<p>if (ModelState.IsValid){}<\/p>\n<p><b>&#8212;write validation in view<\/b><\/p>\n<p>&lt;div&gt;<\/p>\n<p>@using (Html.BeginForm(&#8220;Create&#8221;, &#8220;Client&#8221;, FormMethod.Post, new { @class = &#8220;form-horizontal&#8221;, role = &#8220;form&#8221; }))<\/p>\n<p>{<\/p>\n<p>&lt;div&gt;<\/p>\n<p>&lt;div&gt;@Html.LabelFor(m =&gt; m.Name)<\/p>\n<p>&lt;span&gt;@Html.<b>ValidationMessageFor<\/b>(model =&gt; model.Name)&lt;\/span&gt;&lt;\/div&gt;<\/p>\n<p>&lt;div&gt;@Html.TextBoxFor(m =&gt; m.Name, new { maxlength = 15 })&lt;\/div&gt;<\/p>\n<p>&lt;\/div&gt;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p><b>ValidationMessageFor<\/b> &#8211;Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. The message to display if the specified field contains an error.<\/p>\n<p>&nbsp;<\/p>\n<p>&#8211;Attribute<\/p>\n<p>Difference between attribute and properties<\/p>\n<p><a href=\"http:\/\/www.tutorialspoint.com\/jquery\/jquery-attributes.htm\">http:\/\/www.tutorialspoint.com\/jquery\/jquery-attributes.htm<\/a><\/p>\n<p>&#8211;areas define in mvc<\/p>\n<p>&#8211;how to service implement if server change or server dependancy(what service used if server communication each other and expose service in application in .net)<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee658109.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee658109.aspx<\/a><\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee958158.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee958158.aspx<\/a><\/p>\n<p>&#8211;web api use and purpose of application need<\/p>\n<p>&#8211;where is repository defined<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">&#8212; Check if my model is valid from inside the razor view? Gets the model state dictionary object that contains the state of the model and of model-binding validation. if (ModelState.IsValid){} &#8212;write validation in view &lt;div&gt; @using (Html.BeginForm(&#8220;Create&#8221;, &#8220;Client&#8221;, FormMethod.Post, new { @class = &#8220;form-horizontal&#8221;, role = &#8220;form&#8221; })) { &lt;div&gt; &lt;div&gt;@Html.LabelFor(m =&gt; m.Name) &lt;span&gt;@Html.ValidationMessageFor(model =&gt; model.Name)&lt;\/span&gt;&lt;\/div&gt; &lt;div&gt;@Html.TextBoxFor(m =&gt; m.Name,&hellip; <a href=\"http:\/\/mairwa.com\/wordpress\/?p=257\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9,10],"tags":[],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-c-vb","category-jquery","category-mvc","xfolkentry"],"_links":{"self":[{"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257"}],"version-history":[{"count":0,"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions"}],"wp:attachment":[{"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mairwa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}