Vamsi k

Vamsi k

  • NA
  • 296
  • 42.9k

Hidden field inside gridview

Jan 25 2019 8:12 AM

Hi All,

 

We have 4 hidden fileds in gridview, we want to pass those 4 hidden field values to the javascript function which will open window.
 

asp:TemplateField HeaderText="Vendor Circuit Id">

<ItemTemplate>

<asp:HiddenField ID="hfID" runat="server" ClientIDMode="Static" Value=<%# Eval("Stripped_Vendor_Circuit_ID") %> />

<asp:HiddenField ID="hfName" runat="server" Value=<%# Eval("vendor_name") %> />

<asp:HiddenField ID="hfBAN" runat="server" Value=<%# Eval("Ban") %> />

<asp:HiddenField ID="hfDate" runat="server" Value=<%# Eval("Bill_Date") %> />

<asp:LinkButton ID="lnkVurl" Text=<%# Eval("Stripped_Vendor_Circuit_ID") %> CommandName="VendorURL" runat="server"></asp:LinkButton>

</ItemTemplate>

var windowOptions = "dependent,width=450,height=400,scrollbars=no,resizable=yes,location=no";

function showDetails(t, c, v, b, d) { // added by ab37281 for Circuit Details

alert('YES');

window.name = "FFCL";

t = t.replace("&", "%26")

c = c.replace("&", "%26")

v = v.replace("&", "%26")

b = b.replace("&", "%26")

d = d.replace("&", "%26")

window.open(("circuitDetails.aspx?type=" + t + "&field=" + c + "&vendor=" + v + "&ban=" + b + "&billDate=" + d), "", windowOptions);

}

when we click on hyperlink it should call that javascript function and pass those 4 hidden field value from the grid.
 
Kindly please post code or ideas. 

Answers (1)