[.NET] 隨機變換按鈕位置
請輸入專案類型(網站專案或者應用程式專案):
ASP.NET Web 應用程式
假設網站的版面為下圖
┌──────────┐ ┌──────────┐
│ │ │ │
│ │ │ │
│ │ │ │
│ Button1 │ │ Button2 │
│ │ │ │
│ │ │ │
└──────────┘ └──────────┘
我希望網頁在載入時能隨機交換[Button1]與[Button2]的所在位置
但實在不曉得該怎麼寫(應該是寫Script吧?)
附上一段目前版面配置的程式碼
<table style="width:100%;">
<tr>
<td align="center">
<asp:Button ID="Button1" runat="server" Font-Size="80pt"
Height="320px" onclick="Button1_Click"
Text="Button" Width="400px" BorderStyle="Solid"
BorderWidth="0px" />
</td>
<td>
</td>
<td align="center">
<asp:Button ID="Button2" runat="server" Font-Size="80pt"
Height="320px" onclick="Button2_Click"
Text="Button" Width="400px" BorderStyle="Solid"
BorderWidth="0px" />
</td>
</tr>
</table>
我嘗試在Button ID="Button1"的地方執行Script 可是網頁無法執行
想請教一下板友們
該怎麼寫這段Script
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.35.207.229
→
12/04 20:50, , 1F
12/04 20:50, 1F
→
12/04 20:51, , 2F
12/04 20:51, 2F
→
12/04 20:51, , 3F
12/04 20:51, 3F
→
12/04 20:52, , 4F
12/04 20:52, 4F
→
12/04 20:52, , 5F
12/04 20:52, 5F
→
12/04 20:53, , 6F
12/04 20:53, 6F
→
12/04 20:53, , 7F
12/04 20:53, 7F
→
12/04 20:54, , 8F
12/04 20:54, 8F
→
12/05 03:25, , 9F
12/05 03:25, 9F