I have a function in asp.net mvc , in razor template . I want to naming my function dynamically . but how can I do this ? this is my function :
function ipro-@count() {
numpro-@count = numpro-@count + 1;
document.getElementById("numpro-@count").innerHTML = numpro-@count;
}
count is a dynamic number . it does not work for function name . how can I fix it ?
-in a function name. What string do you actually want to output as the function name, i.e., how would you like the code to look in the browser if you say View Page Source? Judging by what that function seems to be trying to do I think you're trying to solve the underlying problem the wrong way. Why don't you change the function to accept the number as an argument:function ipro(num) { document.getElementById("numpro" + num)...