jeudi 16 avril 2015

Passing parameter ID in URL from GridBoundColumn (GridView) with JS

I am using ASP.NET with C# With the code above with JS i open new window info.aspx . I am trying to pass a parameter in the URL of info.aspx to know the id (RouteNo) of witch item was pressed to show the info of this item. the lines that are comments is the way that I have try to take the Id of the RouteNo.


What I am doing wrong and how I can do it? Is there a way?


routedoc.aspx



<script>

var popUpObj;
// var par = dataItem["RouteNo"];
function RowClick(sender, eventArgs) {
// popUpObj = window.open("Info.aspx?" + para + "",
popUpObj = window.open("Info.aspx?",
"ModalPopUp",
"toolbar=no," +
"scrollbars=no," +
"location=no," +
"statusbar=no," +
"menubar=no," +
"resizable=0," +
"width=500," +
"height=500," +
"left = 300," +
"top=150"
);
popUpObj.focus();
LoadModalDiv();
}


function LoadModalDiv()
{
var bcgDiv = document.getElementById("divBackground");
bcgDiv.style.display="block";
}

function HideModalDiv() {
var bcgDiv = document.getElementById("divBackground");
bcgDiv.style.display = "none";
}
</script>
<telerik:RadGrid ID="RadGrid1" runat="server" GroupPanelPosition="Top" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection="True" Skin="Glow" AllowPaging="True" >
<ExportSettings>
<Pdf PageWidth="">
</Pdf>
</ExportSettings>
<ClientSettings>
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowClick="RowClick" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="RouteNo" PageSize="20" >
<Columns>
<telerik:GridBoundColumn DataField="RouteNo" HeaderText="RouteNo" SortExpression="RouteNo"/>
<telerik:GridBoundColumn DataField="Recipient" HeaderText="Recipient" ReadOnly="True" SortExpression="Recipient"/>
<telerik:GridBoundColumn DataField="DocHandle" HeaderText="DocHandle" ReadOnly="True" SortExpression="DocHandle" />
<telerik:GridBoundColumn DataField="Sender" HeaderText="Sender" ReadOnly="True" SortExpression="Sender" />
<telerik:GridBoundColumn DataField="TermNo" HeaderText="TermNo" SortExpression="TermNo" />
<telerik:GridBoundColumn DataField="SentDate" DataFormatString="{0:yyyy/MM/dd}" HeaderText="SentDate" SortExpression="SentDate" />
<telerik:GridBoundColumn DataField="DueDate" DataFormatString="{0:yyyy/MM/dd}" HeaderText="DueDate" SortExpression="DueDate" />
<telerik:GridBoundColumn DataField="SentTime" HeaderText="SentTime" SortExpression="SentTime" />
<telerik:GridBoundColumn DataField="DueTime" HeaderText="DueTime" SortExpression="DueTime" />
<telerik:GridBoundColumn DataField="Action" HeaderText="Action" SortExpression="Action" />
<telerik:GridBoundColumn DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
<telerik:GridBoundColumn DataField="BUDate" HeaderText="BUDate" SortExpression="BUDate" />
<telerik:GridTemplateColumn HeaderText="Select" UniqueName="AssetId" >
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>

</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="RadButton1" runat="server" Text="Delete" OnClick="RadButton1_Click" Skin="Office2010Black" style="position: relative;">
</telerik:RadButton>




Aucun commentaire:

Enregistrer un commentaire