I’m new to programming so please be gentle. I am making a little Deal or No Deal style game where you open boxes. They are in an update panel and the boxes are set up for different size screens with CSS. It all plays perfectly but when a box is clicked and the ImageUrl is changed, the CSS class is not working. Could it be something to do with the update panel? Here’s my code:
<asp:UpdatePanel ID="upPnlBoxes" style="margin-top:-10px;" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<Triggers>
<asp:AsyncPostBackTrigger controlid="btnBox1" eventname="Click" />
<asp:AsyncPostBackTrigger controlid="btnBox2" eventname="Click" />
</Triggers>
<ContentTemplate>
<div style="position:absolute; top: 420px;">
<asp:ImageButton ID="btnBox1" visible="false" class="playboxsize" commandArgument="1" ImageUrl="~/files/images/icons/boxes/MONMClosedBox1.png" runat="server" onClick="btnBoxSelected_Click" />
<asp:ImageButton ID="btnBox2" visible="false" class="playboxsize" commandArgument="2" ImageUrl="~/files/images/icons/boxes/MONMClosedBox2.png" runat="server" onClick="btnBoxSelected_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
VB.Net
If session("round")="chooseBoxes" Then
Select Case boxNo
Case"1"
btnBox1.imageUrl="~/files/images/icons/boxes/MONMOpenBox" & session("BoxValue1") & ".png"
btnBox1.enabled="false"
session("ValueOpened")=session("BoxValue1")
session("BoxValue1")=0
Case"2".....
End Select
End If