I am trying to access a global variable defined in the class.I am unable to access the variable inside my override function.What should I do??? below is the code :
public partial class VR: System.Web.UI.Page
{
public SqlConnection SQLCONN;
public string headervalue = "";
protected void Page_Load(object sender, EventArgs e)
{
}
// code...............
public class ITextEvents : PdfPageEventHelper
{
// code....
public override void OnEndPage(iTextSharp.text.pdf.PdfWriter writer, iTextSharp.text.Document document)
{
string value = "";
// code.....................................
headervalue //error unable to access it here
}
protected void btnExport_Click(object sender, EventArgs e)
{
headervalue = "abcc";
CreatePDF();
}
I am trying to access headervalue inside public override void OnEndPage method.I am able to access headervalue into btnExport click method