I can make GridView wrapped in UpdatePanel. But when I put it into a control, and put the control in a GridView's itemtemplate, I get
The UpdatePanel 'UpdatePanel2' was not present when the page's InitComplete event was raised. This is usually caused when an UpdatePanel is placed inside a template.
[InvalidOperationException: The UpdatePanel 'UpdatePanel2' was not present when the page's InitComplete event was raised. This is usually caused when an UpdatePanel is placed inside a template.]
Microsoft.Web.UI.UpdatePanel.OnLoad(EventArgs e) +141
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.AddedControl(Control control, Int32 index) +2065605
System.Web.UI.ControlCollection.Add(Control child) +146
System.Web.UI.WebControls.RowControlCollection.Add(Control child) +34
System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +25
System.Web.UI.WebControls.RowControlCollection.AddAt(Int32 index, Control child) +40
System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)
+161
System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3004
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +11
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
I am not sure if it is because I didn't set it right, or ATLAS can not handle it?
hello. well, you can bind in a previous event of the page. for isntance. i've built a small page that shows the kind of problem you're gonna face with this approach: <script runat="server"> public struct A { private string nome; public string Nome { get { return
nome; } set { nome = value; } } private string morada; public string Morada { get { return morada; } set { morada = value; } } public A(string n, string m) { nome = n; morada = m; } } public void Bind() { A[] a= new A[]{ new A( "1", "1" ), new A( "2", "2"
), new A( "3", "3" ) }; grid.DataSource = a; grid.DataBind(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); } protected override void OnInit(EventArgs e) { base.OnInit(e); Bind(); } void T(object sender, EventArgs Args) { info.Text = ((TextBox)sender).Text;
} string Handle(A a) { return a.Nome; } </script> <form id="form1" runat="server"> </form> when you run the page you'll see that the label allways presents the text of the last row...
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
wyx2000
Contributor
3388 Points
873 Posts
Is it possible to put updatepanel in a control that will be used in GridView ItemTemplate?
Mar 20, 2006 05:04 AM|LINK
I can make GridView wrapped in UpdatePanel. But when I put it into a control, and put the control in a GridView's itemtemplate, I get
The UpdatePanel 'UpdatePanel2' was not present when the page's InitComplete event was raised. This is usually caused when an UpdatePanel is placed inside a template.
[InvalidOperationException: The UpdatePanel 'UpdatePanel2' was not present when the page's InitComplete event was raised. This is usually caused when an UpdatePanel is placed inside a template.]
Microsoft.Web.UI.UpdatePanel.OnLoad(EventArgs e) +141
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.AddedControl(Control control, Int32 index) +2065605
System.Web.UI.ControlCollection.Add(Control child) +146
System.Web.UI.WebControls.RowControlCollection.Add(Control child) +34
System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +25
System.Web.UI.WebControls.RowControlCollection.AddAt(Int32 index, Control child) +40
System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +161
System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3004
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +11
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
I am not sure if it is because I didn't set it right, or ATLAS can not handle it?
thanks
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Is it possible to put updatepanel in a control that will be used in GridView ItemTemplate?
Mar 20, 2006 09:08 AM|LINK
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu