This is a migrated thread and some comments may be shown as answers.

DropDownList in MVC Setting Change Event

1 Answer 559 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 2
Ian asked on 22 Jul 2013, 10:34 PM
I'm porting an existing site. in MVC

When the DropDownList Change event fires, I need the DDL to call an existing Function:

This DLL works, but the Change doesn't work, but lets you see the function I need to call:

@(Html.Kendo().DropDownList()
      .Name("clientMenu")
      .BindTo(Model.ClientAccountList)
      .DataValueField("Serialized")
      .DataTextField("Display")
      .Events(e => e.Change("CCCOnline.changeAccount(this);"))
      .Value(selected))

So the DLL needs to send itself to "CCCOnline.changeAccount(this);"

1 Answer, 1 is accepted

Sort by
0
Marco Antonio
Top achievements
Rank 1
answered on 24 Jul 2013, 01:30 AM
Pass only the name of function without (this);
The following code should work:

@(Html.Kendo().DropDownList()
      .Name("clientMenu")
      .BindTo(Model.ClientAccountList)
      .DataValueField("Serialized")
      .DataTextField("Display")
      .Events(e => e.Change("CCCOnline.changeAccount"))
      .Value(selected))
Tags
DropDownList
Asked by
Ian
Top achievements
Rank 2
Answers by
Marco Antonio
Top achievements
Rank 1
Share this question
or