I have a hidden asp Button in a Repeater. In the VB.NET code behind I use the Rerpeater_ItemCommand to get the click event within the Repeater. There's a check if user is already recording a project. If yes and he wants to start a new one, a confirm box should appear asking "Are you sure?" How can I access the click value from confirm?
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
<ItemTemplate>
<div class="tile user_view user_<%# Eval("employeeName") %>">
<div class="tilesheight"></div>
<div class="element">
<asp:Button ID="Button1" CssClass="hiddenbutton" runat="server" />
Index:
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("index") %>' /><br />
<hr class="hr" />
customer:
<asp:Label ID="CustomerLabel" runat="server"
Text='<%# Eval("customer") %>' /><br />
<hr class ="hr" />
order:
<asp:Label ID="OrderNoLabel" runat="server"
Text='<%# Eval("orderNo") %>' /><br />
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Eval("description") %>' /><br />
<hr class="hr" />
</div>
</div>
</ItemTemplate>
</asp:Repeater>
code behind:
If empRecs.Contains(projects.Item(index.Text).employeeID) Then
'Catch index of recording order
i = empRecs.IndexOf(projects.Item(index.Text).employeeID)
Page.ClientScript.RegisterStartupScript(Me.GetType, "confirm", "confirm('Order " & empRecs(i + 2) & " already recording. Would you like to start a new one?')",True)
'If users clicks ok insertData()
End If
Other solutions are using the Click Event and a hidden field. But the problem is, I don't want the confirmbox to appear every time the button is clicked. Only when empRecs conatins an employee.
Thanks for helping