AwesomeParemeters

additonal parameters with predefined values can be sent to the AjaxDropdown and Lookup controllers by doing this:

<%=Html.Lookup("Fruit", parameters: new Dictionary<string,object>{{"par1","hi"}, {"par2", 19 }}) %>

this way in the search action of the lookup controller you will get 2 additional parameters

public ActionResult Search(string search, string par1, int par2)
{
//par1 = "hi"
//par2 = " 19
...
}

but, if you want to do this by using the EditorFor helper, you do this:

[AwesomeParameters("{ par1: 'hi', par2: 19 }")] //it's json
[UIHint("Lookup")]
public int Fruit { get; set; }

Last edited May 12, 2011 at 8:17 AM by o, version 1

Comments

No comments yet.