|
Subscribe
|
I have a master page with a ScriptManager, an ObjectDataReader and a Store connected to the ObjectDataReader. Some of these controls properties are initialized in the normal page (not the master page) because they will be used by different pages. For example:
Master.btnDelete.AjaxEvents.Click.Event += new Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandler(btnDelete_Click); Master.btnInsert.AjaxEvents.Click.Event += new Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandler(btnInsert_Click); Master.btnSave.AjaxEvents.Click.Event += new Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandler(btnSave_Click); Master.btnCancel.AjaxEvents.Click.Event += new Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandler(btnCancel_Click); Master.pSearchDataSource.TypeName = "DB.AdGroups"; Master.pSearchDataSource.SelectMethod = "GetAdGroups";
1. first of all I would like to ask, what is the best place for this code? I put it in the Page_Load method but should it be inside the if (!IsPostBack) { ... } structure, or the best way is to run it everytime?
2. When the Ajax call is done, I checked the response content of the call using Firebug and it contains the masterpage code. Of course, because of that no data loads in the grid.
The code was working perfectly before introducing the masterpage.
|
|
|
ok, I fixed the second issue. The ajax call response was wrong because I forgot to put the following line into my web.config file:
<add name="AjaxRequestModule" type="Coolite.Ext.Web.AjaxRequestModule, Coolite.Ext.Web" />
but the first question still remains: If I want to initialize my controls programatically, like parameters of the JSONReader or text on the buttons, what is the best place to do that?
|
|
|
|