protected void hyGeneratePdf_Click(object sender, EventArgs e)
{
LinkButton linbutton = (System.Web.UI.WebControls.LinkButton)sender;
HttpContext context = this.Context;
string fileName = linbutton.Text.Trim();
string pdfFolderPath = Path.Combine(Server.MapPath("PDF/"), Session["UserName"].ToString());
string filePath = Path.Combine(pdfFolderPath, fileName);
string needZipFiles = filePath;
byte[] zipFileContent = DownLoadSelectFile.createZip(context, needZipFiles, 1);
if (zipFileContent != null)
{
_downPdfFile(zipFileContent,fileName, 1);
}
}
when implementing this code there has en error:The name 'hyGeneratePdf' does not exist in the current context
Can you help me ,where is worng?
this is my code behind:
<asp:Panel ID="panelPdfList" runat="server" ScrollBars="Auto" Height="304px" Width="430px"
valign="top">
<telerik:RadScriptBlock ID="rsbDownLoad" runat="server">
<script type="text/javascript">
function RequestStart(sender, args) {
if (args.get_eventTarget() == "<%=hyGeneratePdf.UniqueID %>",) {
args.set_enableAjax(false);
}
}
</script>
</telerik:RadScriptBlock>
<telerik:RadAjaxPanel ID="rapGridView" runat="server">
<asp:GridView ID="grvPdfFileList" runat="server" AutoGenerateColumns="False" GridLines="None"
Width="400px" ShowHeader="False" OnRowDataBound="grvPdfFileList_RowDataBound">
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkIsChecked" runat="server" OnCheckedChanged="chkIsChecked_CheckedChanged" />
</ItemTemplate>
<ItemStyle Font-Names="Calibri" Font-Size="11pt" HorizontalAlign="Left" Width="40px"
Height="15px" />
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<telerik:RadAjaxPanel ID="rapLinkButton" runat="server" ClientEvents-OnRequestStart="RequestStart">
<asp:LinkButton ID="hyGeneratePdf" CssClass="leftnav" Style="color: Black; font-family: Calibri;"
runat="server" Text='<%#Eval("UserName") %>' OnClick="hyGeneratePdf_Click"></asp:LinkButton>
</telerik:RadAjaxPanel>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" Font-Size="11pt" HorizontalAlign="Left" Width="240px"
Height="15px" />
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblGenerateTime" runat="server" Text='<%#Eval("UserPassword") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" Font-Size="11pt" HorizontalAlign="Left" Width="130px"
Height="15px" />
</asp:TemplateField>
</Columns>
<HeaderStyle Height="0px" />
<RowStyle Height="10px" />
</asp:GridView>
</telerik:RadAjaxPanel>
</asp:Panel>