-1
datalistのeval値をjavascript関数に渡していますが、渡されません。 "First_Name"は渡されませんが、 "Job_Id"パラメータを渡すと値が正常に表示されます。 "First_Name"をどうやって渡すことができますか?以下は私のコードです:datalist evalがjavascriptに渡されませんでした。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>jQuery UI Autocomplete - Multiple values</title>
<script type="text/javascript">
function ShowModalPopup(name) {
alert(name);
return false;
}
</script>
</head>
<body style="margin: 0px 0px 0px 0px;">
<form id="form1" runat="server">
<div style="width: 100%;">
<asp:DataList ID="dlJobs" runat="server" RepeatDirection="Horizontal" RepeatColumns="1"
DataKeyField="Job_Id" CellPadding="10" ItemStyle-VerticalAlign="Top" Width="100%"
OnItemCommand="dlJobs_ItemCommand">
<ItemTemplate>
<div style="font-size: small; float: right; margin-left: 20px;">
<asp:LinkButton ID="lnkContactReferrer" Text="Contact Referrer" runat="server" CommandArgument='<%# Eval("Job_Id") %>'
CommandName="ContactReferrer" Style="background: #4E9CAF; padding: 5px 10px 5px 10px;
text-align: center; border-radius: 5px; color: white; font-weight: bold; text-decoration: none;
margin-left: 5px; margin-right: 5px;" OnClick='<%# "return ShowModalPopup(" +Eval("First_Name") + ");" %>'></asp:LinkButton>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>