c# - How to save in asp.net mvc multiple input boxes text in one record -


i'm new asp.net mvc.

how can save text of 3 input textboxes 1 record concatenating them asp.net mvc?

thanks

html:

@html.textbox("txtnumber") @html.textbox("txtmonth", null, new { maxlength = 2 }) @html.textbox("txtyear") 

controller:

public actionresult addusa(formcollection form) {     using (var db = new databaseimgrecentities())     {         //db.images.add(new image      }     return redirecttoaction("index", "home"); } 

try inside action:-

var allvalues =      string.format("{0}{1}{2}",        form["txtnumber"],        form["txtmonth"],        form["txtyear"]); 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -