c# - ModelState isvalid return false when using querystring -


i new mvc application , need pass vule 1 page page , have used query string using code

@url.action("create", "valuemapping",new { templateid =viewbag.templateid} 

and retriving velue in controller. problem in controller model.isvalid returning false after passing query string. why happenning , way out this.

action code parametrs below

public actionresult create([bind(include = "valuemappingid,valuemappingtypeid,templateid,usefor,sourcevalue,destinationvalue,orgappsyncid,isactive,createdon,lastupdatedon")] valuemapping valuemapping) {} 

thanks utpal maity

is url.action being used action attribute of form? i'm assuming so, simple link not going include data model need valid.

i'm assuming templateid required value, because that's thing makes sense. if you're doing post, query strings out. post body source of data post request. add hidden field store template id:

@html.hidden("templateid", viewbag.templateid string) 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -