asp.net mvc 5 - Keep ViewModel list populated from HTTPGet to HTTPPost ActionResult -


in mvc5 internet application, how can keep contents of viewmodel list, between httpget request , httppost request.

i have done searching, not sure term search for.

here situation:

i have viewmodel, has following list populated in httpget actionresult:

public list<string> azureblobfullfilenames { get; set; } 

in httppost actionresult, list null.

how can still have list populated values in httppost actionresult?

i have added following code after @html.antiforgerytoken() view line of code:

@html.hiddenfor(model => model.azureblobfullfilenames) 

however, list still null in httppost actionresult.

can please have code?

thanks in advance

generate control element in collection using for loop.

for(int = 0; < model.azureblobfullfilenames.count; i++) {   @html.hiddenfor(m => m.azureblobfullfilenames[i]) } 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -