I have some code like this:
return helper.DropDownList(data.ModelEntityId.ToString(), selectList, null, new { onchange = onChange });
Where the onChange variable can be nothing, or loaded from some metadata. This works, however I also want to apply the javascript function to an onload event for that control also.
Is there a way way to apply an onload event to a control? I have tried the following, and even though there are no errors, it does not work.
return helper.DropDownList(data.ModelEntityId.ToString(), selectList, null, new { onchange = onChange, onload = onChange });
Googling about I can only find references the to onload event applying to the whole view. This will not work for me as any javascript I am calling applies to the individual data items on the view rather than the whole view itself.