Showing posts with label ideas. Show all posts
Showing posts with label ideas. Show all posts

Wednesday, March 28, 2012

Paged GridView in update panel doesnt work

Hi, I have paged grid view inside an update panel but when I try to change the page in the grid view nothing happens, any ideas why? thanks for your help.

Could you post your code so we can see exactly what you are doing?


Yes, here is the gridviewcode

<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="12" AutoGenerateColumns="False">
<FooterStyle BackColor="White" ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="# Cuota" HeaderText="# Cuota" />
<asp:BoundField DataField="Saldo Inicial" HeaderText="Saldo Inicial" />
<asp:BoundField DataField="MontoInteres" HeaderText="Monto Interes" DataFormatString="{0:C}" HtmlEncode="False" />
<asp:BoundField DataField="Monto Cuota" HeaderText="Monto Cuota" />
<asp:BoundField DataField="MontoCapital" HeaderText="Monto Capital" DataFormatString="{0:C}" HtmlEncode="False" />
</Columns>
</asp:GridView>

The grid view gets filled with data, it just wont let me browse through the grid view pages and it works outside the update panel.


Nevermind, outside the update panel it just postbacks but I hadnt notice the information is the same. I dont have any eventhandler set on the gridview.


I made it work. I just added this code


protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{

GridView1.DataSource = ViewState["DataTable"] as DataTable ;
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
}

Thanks for your help.

Monday, March 26, 2012

PageRequestManagerParserErrorException with the Update Panel

I have spent quite a bit of time researching this and I cannot figure it out. So if there is anybody that has any ideas I am all ears.

I have a pretty simple site that uses a few update panels. I am developing with VS2005 on XP all the patches and using ASP.NET AJAX 1.0. Everything works perfect on my dev machine and on second beta server I have. When everything get moved to the client site they get the "PageRequestManagerParserErrorException" error on the pages with the update panel. I am not using server.transfer or respnse.write() or any other known issues. The client machine is a test box that was imaged for this app. Running Win2003 all clean and up to date in a pretty standard configuration.

I am just looking for direction: I saw some posts about response caching and machinekey but I have no idea what to look for or what to direct the sys admin to look for.

Any help would be greatly appreciated.

Craig.

Have a look here for troubleshooting tips:http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx

Also see this related post:http://forums.asp.net/p/1038252/1439637.aspx

Hope these help...

-Damien


Damien,

Thanks for the links. In my searching I did come accross them (and meany others). So I threw up a server outside of my network that and tried to hit the pages with an update panel again. And this time I get the error (sometimes). It was strange that I would sometimes get an error and others I wouldn't. So I installed fiddler to see what the response was like. When I get an error I notice this in the respose;

[HttpException (0x80004005): Server cannot modify cookies after HTTP headers have been sent.]
System.Web.HttpCookieCollection.Add(HttpCookie cookie) +103
System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs) +650
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

I am using a master page that will show differnt information based on the user's role. My guess is that the injection of this error into the response is causing the problem because when it works there is no error. Unfortunatly I don't know what this means yetHmm. Guess it's back to the internet for some studying.

If anybody has any sugestions or direction on addressing this issue I would welcome the advice.

Regards,

Craig


Got it!Big Smile

This link was the answerhttp://forums.asp.net/p/1069056/1556225.aspx#1556225

I still need to read up on the issue but the answer was to set the cacheRolesInCookie=false in the web.config file. Made the change and all is good. Although, I now wonder what the impact is now on perfomance.

Craig

PageRequestManagerServerErrorException 12019 12130 12031 and 12152

Any ideas what causes the following error message:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code is:

I receive one of 4 error numbers: 12019 12130 12031 or 12152

I believe it might have to do with a content switch but not sure. Any help would be greatly appreciated.

I am getting the same Error Message with error number :12031...

Any suggestion ?


Hi,

Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.


Hi,

it is true that it is about Wininet api.i can access my page and can work with Another browsers but with IE 7.0 OR 6.0 i come accross with this error.(in I.E The error code is 404)..What is ur advice to solve this problem?When i launch the project without connecting to source safe,it works but after i connect to sourcesafe,this problem occurs..This error is very annoying.What should i do?Thank u very much for ur Help.(My problem doesnt depend on Data Intesivity or row count)


Raymond Wen - MSFT:

Hi, Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.

So, seeing this error on a partial-page update (UpdatePanel Async postback) means that the application I'm developing is not going to work with Internet Explorer? Or is this just a fluke that will go away on a restart / deployment scenario / etc.

I'm getting this one:

 12019 ERROR_INTERNET_INCORRECT_HANDLE_STATE
The requested operation cannot be carried out because the handle supplied is not in the correct state.



Hi

we had the same problem on our live-system. It was caused by SSL-Connection. If you have SSL, try turning off Keep Alive for IE.


hth


Just so you know, we did find one possible cause of this problem.

It seems to crop up sometimes if you are using IE6 supplied with MultipleIEs package.

http://forums.asp.net/t/1123365.aspx