############################## aspx page
<script>
$(document).ready(function () {
$(".dialog-modal-history").dialog({
height: 450,
width: 700,
autoOpen: false,
modal: true,
dialogClass: 'Dialog',
title: 'Work History'
});
$('.butHistoryDialog').click(function () {
$('.dialog-modal-history').dialog('open');
// prevent the default action, e.g., following a link
return false;
});
$('.dialogclose').click(function () {
$('.dialog-modal-history').dialog('close');
// prevent the default action, e.g., following a link
return false;
});
});
function HistoryClick() {
dialog = document.getElementById("butHistoryDialog");
dialog.click();
}
</script>
<asp:Repeater runat="server" ID="rptJobHistory" OnItemDataBound="rptJobHistory_OnItemDataBound">
<ItemTemplate>
<tr class="<%# Container.ItemIndex % 2 == 0 ? "Odd" : "Even" %>">
<td>
<%# Eval("DateStart", "{0:MMM yyyy}")%>
</td>
<td>
<%# ifdatenotend(Eval("DateEnd", "{0:MMM yyyy}"))%>
</td>
<td>
<%# Eval("Title") %>
</td>
<td>
<%# Eval("Company") %>
</td>
<td>
<asp:LinkButton ID="View" runat="server" CommandArgument=<%# Eval("ID") %>>Edit</asp:LinkButton>
</td>
<td>
<asp:LinkButton runat="server" OnClick="Delete" CommandArgument=<%# Eval("ID") %>>Delete</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table></td>
<td><asp:Button ID="butAddJobHistory" runat="server" Text="Add History" SkinID="MessageButton" CssClass="opener" />
<input runat="server" ID="butHistoryDialog" type="button" class="butHistoryDialog" clientidmode="Static" /></td>
</tr>
</table>
####################### code behind
protected void rptJobHistory_OnItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
LinkButton ViewHistory = e.Item.FindControl("View") as LinkButton;
ViewHistory.Click += new EventHandler(History);
smUpdate.RegisterAsyncPostBackControl(ViewHistory);
ViewHistory.Attributes.Add("onclick", "javascript:HistoryClick();");
}
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE