how to add onclick javascript for Dictionary<string, string>?
I have a Dictionary object in my view as
<% System.Collections.Generic.Dictionary<string, string> param= new Dictio开发者_运维问答nary<string, string>();; %>
<% {
param.Add("id","AdditionalPrincipalAmount");
param.Add("onblur", "TotalPaymentAmount()");
} %>
does JavaScript call only work for Dictionary<string, object>
or does it also work for Dictionary<string, string>
?
You're creating a dictionary here in your C# code however you don't seem to be doing anything with it.
The Dictionary itself is never present on the front end to the browser which is the main realm of Javascript.
Basically, Javascript has no knowlege of the Dictionary you create in C#.
I could be mistaken, but I don't think you can add an onclick event to a dictionary. A dictionary is a collection, not a control. Not very knowledgable when it comes to MVC, but it doesn't seem logical...
精彩评论