c# - How to pass value to function using DropDownListFor -


i have c# web mvc app has dropdownlist 2 items follows:

current version previous version

when dropdownlist selected versiondata java script function being called can’t seem selected item value passed in function:

@html.dropdownlistfor(x => x.items, model.items,"",new {ng_model="versionid " , ng_change="versiondata(versionid) })" 

depending on item selected value should passed function.

example : current version: value = v1 previous version: value = v2

so when functioning called should pass value like… versiondata(v1)….

how can achieve this?

why not value in javascript function calling using jquery?

so do:

function versiondata() {     $("dropdownlistname").find(":selected").text() } 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -