Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<pre><div class="filter">
                        <h5>class="fa fa-list"> Class</h5>

                        <ul>

                            @foreach (var items in Model)
                            {
                                <li>

                                    <input id="@items.T_Klas.UcretTipi" type="checkbox" value="@items.KlasID" name="@items.T_Klas.UcretTipi">@items.T_Klas.UcretTipi

                                    <input id="chk" type="submit" value="Economy">

                                </li>
                            }

                        </ul>

                    </div>

Controller

<pre> [HttpPost]
        public ActionResult Talepler(bool? Economy)
        {
            
            List<T_Talepler> talep = new List<T_Talepler>();

            if (Economy == true)
            {
                talep = (from v in shy.T_Talepler where v.T_Klas.KlasID == checkboxid select v).ToList();
            }


            return View(talep);
        }


What I have tried:

Hi everyone.

I need to value="@KlasID" how can I do.

İf I click checkbox true.
Posted
Comments
Karthik_Mahalingam 18-Oct-17 23:49pm    
Not clear
Use Improve question to add more info to the question.
David_Wimbley 19-Oct-17 1:33am    
You should look at adjusting the type of input you are using. Checkboxes pass back true/false. You should look at using a drop down list.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900