Wednesday, March 21, 2012

Partial rendering issue

The update panel sometimes doesn't work.

I have a masterpage referencing the scriptmanager:
<atlas:ScriptManagerID="mainAtlasScripts"runat="server"EnableViewState="true"EnableScriptComponents="true"EnablePartialRendering="true"></atlas:ScriptManager>

I have a page that displays a gridview with a table under it to insert rows in the gridview
<atlas:UpdatePanelID="updList"runat="server"Mode="conditional">
<Triggers>
<atlas:ControlEventTriggerControlID="btImport"EventName="Click"/>
</Triggers>
<ContentTemplate>
<asp:GridViewID="gvList"runat="server"AllowPaging="True"AutoGenerateColumns="False"
DataSourceID="odsData"Width="100%"ShowHeader="False"
OnSelectedIndexChanged="gvList_SelectedIndexChanged">
<Columns>
<asp:TemplateFieldHeaderText="Title"SortExpression="Title"ShowHeader="False">
<ItemTemplate>
FieldContent
</ItemTemplate>
</Columns>
</asp:GridView>
</ContentTemplate>
</atlas:UpdatePanel>
<asp:TextBoxID="tbImport"runat="server"asp:TextBox>
<asp:ButtonID="btImport"runat="server"Text="Import"Height="19px"OnClick="btImport_Click"/>

But when I click on the btImport button I get some javascript error saying object required. The update is done tho, but the rendering of the page to the browser doesn't work. So if I click will add the item to the list but the gridview won't be showing me the update.

I would really like to start using this updatepanel because it will save me a lot of time not having to javascript code for updating my page for every single thing.

For basic operations it does work.. just not on the page where I need it at this moment..
So if i put on the same page a different updatepanel with a label in the contenttemplate and a button as trigger then it does work but obviously of no use to me

I have to correct myself because it does work untill I put the updatepanel in a multiview.
I will just go back to updating my html from javascript and calling a webservice as I did before..

casual jim wrote:

The update panel sometimes doesn't work.

I have a masterpage referencing the scriptmanager:
<atlas:ScriptManagerID="mainAtlasScripts"runat="server"EnableViewState="true"EnableScriptComponents="true"EnablePartialRendering="true"></atlas:ScriptManager>

I have a page that displays a gridview with a table under it to insert rows in the gridview
<atlas:UpdatePanelID="updList"runat="server"Mode="conditional">
<Triggers>
<atlas:ControlEventTriggerControlID="btImport"EventName="Click"/>
</Triggers>
<ContentTemplate>
<asp:GridViewID="gvList"runat="server"AllowPaging="True"AutoGenerateColumns="False"
DataSourceID="odsData"Width="100%"ShowHeader="False"
OnSelectedIndexChanged="gvList_SelectedIndexChanged">
<Columns>
<asp:TemplateFieldHeaderText="Title"SortExpression="Title"ShowHeader="False">
<ItemTemplate>
FieldContent
</ItemTemplate>
</Columns>
</asp:GridView>
</ContentTemplate>
</atlas:UpdatePanel>
<asp:TextBoxID="tbImport"runat="server"asp:TextBox>
<asp:ButtonID="btImport"runat="server"Text="Import"Height="19px"OnClick="btImport_Click"/>

But when I click on the btImport button I get some javascript error saying object required. The update is done tho, but the rendering of the page to the browser doesn't work. So if I click will add the item to the list but the gridview won't be showing me the update.

I would really like to start using this updatepanel because it will save me a lot of time not having to javascript code for updating my page for every single thing.

For basic operations it does work.. just not on the page where I need it at this moment..
So if i put on the same page a different updatepanel with a label in the contenttemplate and a button as trigger then it does work but obviously of no use to me


I′m also getting the same error. Did you get around it yet?

I also experienced this...what I did was remove the triger portion of the update panel incases where I only have one update panel on the page. It seemed to work but I did experience some additional page flicker but nothing compared to a full postback. I think that this is a bug with the Click event handler on the trigger. The control builder/wizard/whatever doenst recongize the click event of some buttons.

Good Luck!


Could it be that you need to include the textbox and Button within the update panel?

IE:

<asp:TextBoxID="tbImport"runat="server"asp:TextBox>
<asp:ButtonID="btImport"runat="server"Text="Import"Height="19px"OnClick="btImport_Click"/>
</atlas:UpdatePanel
This way there is no requirement in the backend code to call the update event... it all should be wrapped seemlessly with no changes to normal code there...


it is an issue with the multiview in my case. The work around is to just use panels instead of the multiview

I decided in my case that the partial update indeed is AJAX but defeats the purpose because you are always sending back the full page. I refactored to use the clientscript based implementation.

You get a flicker with the partial rendering for the images and i didn't like it.

No comments:

Post a Comment