how to pass selected value of AjaxDropdown to my razor page code handler call
in my razor cshtml page: the dropdowns are filled with data @(Html.Awe().AjaxDropdown("ParentDisasters").Url(Url.Page("rp_telecoms", "GetDisasters"))) @Html.Awe().AjaxDropdown("Communities").Url(Url.Page("rp_telecoms", "GetCommunities")).Parent("ParentDisasters") I need a button (one of the 2 commented out below) to run a report. @Html.Awe().Button().Text("Run Report") so how to pass selected value of AjaxDropdown to my razor page code handler call ?
asked at 29 Oct 2019
the same way you would do it for a simple `input`, the AjaxDropdown will generate a hidden input with id and name attributes, you can use a simple textbox instead of the AjaxDropdown and you'll have the same problem to solve if you have an html `input` you either put it inside a form and post the form (manually by the user or via js), or get it via js `var val = $('#id').val()` and send this val with an ajax request.
answered at 29 Oct 2019
Somehow I end up doing the right thing (after a lot of time wasting) even though I'm not knowledgeable enough on this new stuff. Its working now because I renamed my Input variable defined in the page code to the same name as the AjaxDropdown (after you told me about the hidden field) i wanted to get the value from. I was in happy shock when it worked because I'm trying out things and guessing largely. I sent a new comment asking for more help and then deleted it after i got it working. Thank You again
at 29 Oct 2019
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our