i have a gridview on page which a text field( read only ) and a link button , which when clicked opens up a pop up. on teh pop up i have a repeator whihc shows some values froma table. These values on the pop up are also link buttons. now when i click on the link ( in gridview - on orw data command change), it opens up the pop up. on the Pop up o select a value and once i click on teh value ( which is alink button) the pop should close and the selected vlaue should update the Test field for that particular row griewview on the page. but this is not happening, it gives me null value. let me know how can i hold that value on the pop up and then update the same on the text field in teh gridview.
html code :
<%@ Register Assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Assembly Name="ITools.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" %>
<%--for popo up--%>
<SharePoint:CssRegistration Name="/_layouts/1033/HML Org Change/Styles/CSS.css" ID="css"
After="corev4.css" runat="server">
</SharePoint:CssRegistration>
<SharePoint:ScriptLink ID="ScriptLinkMenu1" runat="server" Name="/_layouts/1033/JS/jquery-1.4.1.js"
Language="javascript">
</SharePoint:ScriptLink>
<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="/_layouts/1033/JS/jquery-1.4.1.min.js"
Language="javascript">
</SharePoint:ScriptLink>
<SharePoint:ScriptLink ID="ScriptLink2" runat="server" Name="/_layouts/JS/jquery.blockUI.js"
Language="javascript">
</SharePoint:ScriptLink>
<link href="../StyleSheets/CORE.css" rel="stylesheet" type="text/css" media="all" />
<%--pop up--%>
<script language="javascript" type="text/javascript">
// function for pop up
function BlockUI(elementID) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(function () {
$("#" + elementID).block({ message: '<table align = "center"><tr><td>' +
'<img src="images/loadingAnim.gif"/></td></tr></table>',
css: {},
overlayCSS: { backgroundColor: '#000000', opacity: 0.6
}
});
});
prm.add_endRequest(function () {
$("#" + elementID).unblock();
});
}
$(document).ready(function () {
BlockUI("<%=pnlPopUp.ClientID %>");
$.blockUI.defaults.css = {};
});
function Hidepopup() {
$find("mpePopUp").hide();
return false;
}
</script>
<asp:ScriptManagerProxy ID="scrMGR" runat="server">
</asp:ScriptManagerProxy>
<br />
<asp:GridView AutoGenerateColumns="false" BorderWidth="1" ID="gvWBSPendingDetails"
runat="server" Width="100%" EmptyDataText="No Pending Records" CellPadding="4"
ForeColor="#333333" OnRowDataBound="gvWBSPendingDetails_RowDataBound" OnRowCommand="gvWBSPendingDetails_RowCommand">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input id="chkAll" value="Select All" onclick="SelectAllCheckboxes(this);" runat="server"
type="checkbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkApprove" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Portal ID">
<ItemTemplate>
<asp:Label ID="lblPortalID" Text='<%#DataBinder.Eval(Container.DataItem, "Portal ID") %>'
runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Employee Code">
<ItemTemplate>
<asp:Label ID="lblEmployeeCode" Text='<%#DataBinder.Eval(Container.DataItem, "Employee Code") %>'
runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Employee Name">
<ItemTemplate>
<asp:Label ID="lblEmployeeName" Text='<%#DataBinder.Eval(Container.DataItem, "Employee Name") %>'
runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Account">
<ItemTemplate>
<asp:DropDownList ID="ddlAcc" runat="server" AppendDataBoundItems="true">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Project ID">
<ItemTemplate>
<asp:TextBox ID="txtProj" runat="server" Enabled="false" CssClass="ms-long"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Select Project">
<ItemTemplate>
<asp:LinkButton ID="lnbtn" CommandName="select project" CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'
runat="server">Project ID</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Worked Date">
<ItemTemplate>
<asp:Label ID="lblWorkedDate" Text='<%#DataBinder.Eval(Container.DataItem, "Worked Date") %>'
runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Submitt">
<ItemTemplate>
<asp:Button ID="btnClick" runat="server" Text="Submitt" OnClick="btnClick_Click" />
</ItemTemplate>
<ItemStyle />
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" Font-Bold="False" HorizontalAlign="center" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="LightSteelBlue" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="LightSteelBlue" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<table align="left">
<tr>
<td>
<asp:Label ID="lblError" runat="server" ForeColor="Red" Visible="False" Font-Bold="False"
Font-Size="X-Small"></asp:Label>
</td>
</tr>
</table>
<%--Panel for pop up--%>
<asp:Panel ID="pnlPopUp" runat="server" CssClass="modalPopup" Style="display: none">
<asp:Label Font-Bold="true" ID="lblPopUpHeader" runat="server"></asp:Label>
<br />
<table>
<tr>
<td>
<asp:Repeater ID="rtProjects" runat="server" OnItemCommand="rtProjects_ItemCommand">
<ItemTemplate>
<div>
<asp:LinkButton ID="lbtnProj1" runat="server" Text='<%#Eval("PROJECT_ID") %>' CommandName="PROJECT_ID"
CommandArgument='<%# Eval("PROJECT_ID") %>'></asp:LinkButton>
</div>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClientClick="return Hidepopup()" />
</td>
</tr>
</table>
</asp:Panel>
<asp:LinkButton ID="lnkFake" runat="server"></asp:LinkButton>
<cc1:ModalPopupExtender ID="mpePopUp" runat="server" DropShadow="false" PopupControlID="pnlPopUp"
TargetControlID="lnkFake" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<%--<cc1:ModalPopupExtender ID="mpePopUp" runat="server" DropShadow="false" PopupControlID="pnlPopUp"
TargetControlID="lnkFake" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>--%>
<%-- for account and project end--%>
<asp:HiddenField runat="server" ID="hdnID" />
<asp:HiddenField runat="server" ID="hdnAction" />
<asp:HiddenField runat="server" ID="hdnEmail" />
<%-- pop up end--%>