Mar 11, 2011, 2:02 PM
[CLOSED] Calling a UserControl Direct Event method from a different page
We are calling theusercontrol's direct event method from a different cs file. However we cannot assign a Session Value on the direct event method.
Please look at the code.
Please look at the code.
//This is the cs file calling the usercontrol
Ext.Net.Button btnSee = ((Ext.Net.Button)ucGrid1.getGrid.BottomBar[0].Items[0]);
btnSee.DirectClick += new UserControl_VPNSurec().seePDFForm;
btnSee.DirectEvents.Click.ExtraParams.Add(new Ext.Net.Parameter { Name = "Values", Value = "Ext.encode(#{Grid1}.getRowsValues({selectedOnly : false}))", Mode = ParameterMode.Raw });
//This is the code behing on user control page
public void seePDFForm(object sender, DirectEventArgs e)
{
string json = e.ExtraParams["Values"];
Dictionary<string, string>[] selectedVal = JSON.Deserialize<Dictionary<string, string>[]>(json);
int formid = Convert.ToInt32((selectedVal[0]["formid"]).ToString());
Session[SystemVariables.VPN_FORM_ID] = formid; //The program fails here error is Session is NULL - Null reference exception
}
Last edited by Daniil; Mar 15, 2011 at 7:54 AM.
Reason: [CLOSED]