How to add String Text to strongly typed views in MVC, for instance, I have got:
<div class="editor-field">
<%: Html.TextBoxFor(model => model.productWebsite, new { style = "width:300px;" })%>
<%: Html.ValidationMessageFor(model => model.productWebsite)%>
</div>
I want to add “http://” to model.productWebsite so when user writes www.abc.com , on tryupdatemodel it should save as http://www.abc.com in the database.
I tried doing something like : <%: Html.TextBoxFor(model => "http://" + model.productWebsite, new { style = "width:300px;" })%> which doesnt works.
Surely this is something you should be handling within the controller when the model is being updated?
Like this: