Note that there are some explanatory texts on larger screens.

plurals
  1. POLoad multiple Images dynamically from folder based on dropdown list selected option in asp.net
    primarykey
    data
    text
    <p>Load multiple Images dynamically from folder based on dropdown list selected option in asp.net. Can anyone help me with this to implement in visual studio? this is the code i tried, help me with better option or modify this, also i need to bind the image output to image button control as slideshow.</p> <pre><code> &lt;script type="text/javascript"&gt; function new1(city) { switch (city) { case "Patna": var imlocation = "Patna/"; var currentdate = 0; var image_number = 0; function ImageArray(n) { this.length = n; for (var i = 1; i &lt;= n; i++) { this[i] = ' ' } } image = new ImageArray(2) image[0] = '2.jpg' image[1] = '3.jpg' var rand = 60 / image.length function randomimage() { currentdate = new Date() image_number = currentdate.getSeconds() image_number = Math.floor(image_number / rand) return (image[image_number]) } document.write("&lt;img src='" + imlocation + randomimage() + "'&gt;"); case "Bhopal": var imlocation1 = "Bhopal/"; var currentdate1 = 0; var image_number1 = 0; function ImageArray1(n) { this.length = n; for (var i = 1; i &lt;= n; i++) { this[i] = ' ' } } image1 = new ImageArray1(3) image1[0] = '2.jpg' image1[1] = '4.jpg' image1[2] = '1.jpg' var rand1 = 100/ image1.length function randomimage1() { currentdate1 = new Date() image_number1 = currentdate1.getSeconds() image_number1 = Math.floor(image_number1 / rand1) return (image1[image_number1]) } document.write("&lt;img src='" + imlocation1 + randomimage1() + "'&gt;"); } } &lt;asp:DropDownList ID="DropDownList1" runat="server" onchange="new1(this.value)" DataSourceID="SqlDataSource1" DataTextField="City" DataValueField="City" onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True" &gt; &lt;/asp:DropDownList&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload