ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
how to pass AjaxRadioList selected value as parameter on button click event
Title:
B
I
{code}
?
@(Html.Awe().AjaxRadioList("RemoteSearchOdropdown") .Odropdown(o => o.SearchFunc("utils.osearch", Url.Action("SearchMeals", "TreeGrid"), "m1")) .Value(-1) .Url(Url.Action("GetMealsInit", "TreeGrid"))) <div class="bar"> <form method="post" action="@Url.Action("LoadInitialData",new { Id = $('#RemoteSearchOdropdown').val() })" class="ib"> <input id="load" type="submit" class="awe-btn" value="Load" /> </form> </div>
Save Changes
Cancel
Chandra Mohan
asked at 27 Feb 2018
why is `.Value(-1)` ? `Url.Action` is generated at the server, so it makes no sense to set Id = $(...).val(). you could just put the dropdown inside the form, what are you trying to do ?
at 27 Feb 2018
Omu
On click of load button, i want load my treegrid and some textbox values, based on the dropdown selected value. So I want to know how can i pass dropdown selected value to the controller on clcik of load button.
at 27 Feb 2018
Chandra Mohan
if the grid is present already you could just use .Parent to bind it to the dropdown; if you're loading it as a partial via ajax on Load button click, put the odropdown inside the form, or put a hidden input inside the form and on dropdown 'aweload change' event set the hidden input's value
at 27 Feb 2018
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK