c# event on combobox using razor

78 Views Asked by At

I'm using a combobox on the layout view and i need to call a method on a controller when an index is changed

Here is what i have on _Layout.cshtml

        <select id="combo" OnSelectedIndexChanged="IndexChanged" AutoPostBack="True" runat="server">
                <option> xxx</option>
                <option>yyy</option>
        </select>

And i call the method on controller

 public void IndexChanged(object o, EventArgs e)
    {
        if(... ){

        }else{

        }
    }

But the program never reach the method, and i dont know why..Ideas?

I already saw other questions, but nothing works for me. I tried put the method on the view, create a method without params ... nothing works

0

There are 0 best solutions below