Open a Dialog () from a .JS file using a DropDownList

-1

Hi, I am new programming and I would like to know if you can have an Dropdown list of asp that opens depending on the selection, a dialog () of jquery but that this dialog () is inside a common file .js

I have a script that when placed directly on the page opens without problems but I want to use it and make it "Common" in a .JS and open it within another page of the same project.

Is it possible?

and if you can, I need an example to do it.

    
asked by Kyuwan Lightskater 27.11.2018 в 17:19
source

1 answer

0

you can do it with javascript jquery

@Html.DropDownList("Sortby", new SelectListItem[] 
 { new SelectListItem() { Text = "Newest to Oldest", Value = "0" }, 
   new SelectListItem() { Text = "Oldest to Newest", Value = "1" }},
   new { @onchange="CallChangefunc(this.value)" })

<script>
function CallChangefunc(val)
{
 $( "#dialog" ).dialog();;
}
 </script>
<div id="dialog" title="Basic dialog">
  <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

the source is in the comment that I wrote

    
answered by 27.11.2018 / 17:35
source