Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Monday, March 26, 2012

PageRequestManagerParseErrorException

Hello. I'm have the problem with UpdatePanel. When the user does click on de button I call a method

Button1_Click

This method call other page in modo modal where the user type a password. If this password is ok I'll try to use

UpdatePanell2.Update() but I can′t call the page2 in modo modal because appear this error.

Read this to avoid this issue:

http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx

PageRequestManager events being called too many times

I'm studying the PageRequestManager event lifecyle. It appears that when the number of times i click the linkbutton to perform the asynch postback, that same number of times the event is being called. Here's the scenario: I click the linkbutton once. Alerts for all events are called. I click the linkbutton once again. Alerts for all events are called twice. I click the linkbutton once again. Alerts for all events are called 3x. ... etc. Heres the sample code:

/*************************** aspx code ************************/

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="AsynchronousLifeCycle.js" />
</Scripts>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Date: "></asp:Label><br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Push me!" />
</ContentTemplate>
</asp:UpdatePanel>
</form>

/******** js code *************************************/

Sys.Application.add_load(ApplicationLoadHandler)
Sys.Application.notifyScriptLoaded();


function ApplicationLoadHandler(sender, args)
{
Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(InitializeRequest);
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(PageLoading);
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(PageLoaded);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
}

function InitializeRequest(sender, args)
{
alert("InitializeRequest");
}

function BeginRequest(sender, args)
{
alert("BeginRequest");
}

function PageLoading(sender, args)
{
alert("PageLoading");
}

function PageLoaded(sender, args)
{
alert("PageLoaded");
}

function PageLoaded(sender, args)
{
alert("PageLoaded");
}

function EndRequest(sender, args)
{
alert("EndRequest");
}

hi,

Please refer below URL:

http://ajax.asp.net/docs/ClientReference/Sys.WebForms/PageRequestManagerClass/PageRequestManagerBeginRequestEvent.aspx

Thanks

kishore

www.relgo.com.

PageRequestManagerParserErrorException

I really hope someone can help me...

Scenario:

A button inside an UpdatePanel
If when I click the button I execute a Response.Redirect inside the button's event handler I get aPageRequestManagerParserErrorException exception.

This didn't happen with any of the betas (just updated to 1.0).

Any ideas?

Can you post your code. Do you by any chance call Response.Flush?
The code is quite large but I have found that this can be very easily reproduced.
To reproduce the problem you just have to enclose a button that executes Response.Redirect inside an UpdatePanel:

HTML Code:

<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Login" %><%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table id="tblLogin"> <tr> <td>Login</td> <td><asp:TextBox ID="txtLogin" runat="server"></asp:TextBox></td> </tr> <tr> <td>Password</td> <td><asp:TextBox ID="txtPassword" TextMode="Password" runat="server"></asp:TextBox></td> </tr> <tr> <td colspan="2"> <asp:UpdatePanel ID="testPanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Button ID="btnLogin" runat="server" Text="Login" /> </ContentTemplate> </asp:UpdatePanel> </td> </tr> </table> <asp:Label id="lblErrorMsg" runat="server" ForeColor="Red"></asp:Label> <div id="dInvBrowser" class="errMsg" style="display:none; color:#FF0000; font-weight:bold;">Por favor, solamente utilice Internet Explorer 6.0 (o superior) para acceder al sistema</div> <script language="javascript" type="text/javascript">if(!IE || SM || OP || KQ || (BV<6)) {//document.getElementById("tblLogin").style.display="none";//document.getElementById("dInvBrowser").style.display="block";}</asp:Content>
Code Behind:
Protected Sub btnLogin_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles btnLogin.Click
Response.Redirect("/testpage.aspx")
End Sub
If I remove the "testPanel" then everything works just fine.
Anyone?Help on this issue will be GREATLY appreciated...

Is the page in question protected by a rolemanager/roleprovider? If so see:

http://forums.asp.net/thread/1555817.aspx


No...
Remember this was working perfectly before installing the 1.0 final release of ASP.NET AJAX

Also, you should be able to easily reproduce it: just create an UpdatePanel, insert a button and then simply call Response.Redirect("somee_page.aspx") in the button's click event.


I didn't try your exact code, but I tried this code, and it worked fine... can you spot any differences?

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> public void button_click(object sender, EventArgs e) { Response.Redirect("http://www.microsoft.com"); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="sm" runat="server" /> <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Button ID="button" runat="server" OnClick="button_click" Text="Click Me" /> </ContentTemplate> </asp:UpdatePanel> </form></body></html>

Thank you SO much Steve!

By just looking at your code I realized I had something wrong with my application: I did not correctly upgrade from the last beta to the 1.0
So I re-read the documentation to perform the upgrade and everything is now working perfectly.

Again, thank you VERY much.


This a must read from Eilon Lipton's Technical blog on MicrosoftASP.NET and ASP.NET AJAX when trying to solvePageRequestManagerParserErrorException errors!

http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx?CommentPosted=true#commentmessage A

Saturday, March 24, 2012

PageRequestManagerServerErrorException with 500 error code

In javascript I'm setting the value property of a button within an update panel before calling click() on the button to refresh the update panel. (I need to refresh an update panel and pass extra data on the callback, and no one on this forum has yet described a better way of doing it than this.)

This was all working in tests that I did last week, but I'm now getting the following error message box in IE:

"Sys.WebForms.PageRequestManagerServerErrorException: An unkown error ocurred while processing the request on the server. The status code returned from the server was: 500"

Any ideas?

I have the same error but on a couple of dropdown which update one another's datesource with updatePanels.

If i change the value of the first dropdown for several times, always the third tine gives this error.

I found on a post the setting TRACE off resolves but not for me.

Any ideas ?

Just try to change frequently some controls which use updatepanels (for other controls) and see what's happen.

Thank's

Sorin


I found also that If I have more than 3 UpdatePanels in a Page I get this error after 3 callbacks.

If I have on page Trace="false"and "EnableEventValidation="true"

I get this error:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Thank's again


I've also tried setting the value of a hidden field and a hidden textbox and both raise the same error.

I cannot even paste data into a textbox and then do a postback without getting this error.

I'm also EXTREMELY TIRED OF MICROSOFT IGNORING ALL OF MY POSTS!!!!!!!!!!! Angry

Paging a GridView in an UpdatePanel

Has anyone been able to implement paging for a GridView inside an UpdatePanel?

I get a JavaScript error everytime I click on the page number: "Object Required".

Enclosing the GridView control inside an UpdatePanel worked fine for me, including the paging.

Have you tried stepping through your code with VisualStudio? This works really good for me when debugging atlas. Also if your gridview is bound to a SqlDataSource you can enable PagingAndSortingCallbacks, and that has the same effect.


hello.

can you show us your code?

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"/>

<atlas:UpdatePanelID="EmpOrders"runat="server"Mode="Conditional">

<Triggers><atlas:ControlEventTriggerControlID="Button1"EventName="Click"/></Triggers>

<ContentTemplate>

<asp:ButtonID="Button1"runat="server"Font-Italic="True"OnClick="Button1_Click1"Text="Search"/><br/>

<asp:GridViewID="GridView1"runat="server"CellPadding="4"ForeColor="#333333"GridLines="None"PageSize="15"AllowPaging="True"AutoGenerateColumns="False"OnPageIndexChanging="GridView1_PageIndexChanging"AllowSorting="True">

<Columns>

<asp:BoundFieldDataField="ShipName"HeaderText="Ship Name"SortExpression="ShipName"/>

<asp:BoundFieldDataField="ShipCountry"HeaderText="Country"SortExpression="Country"/>

<asp:BoundFieldDataField="Freight"HeaderText="Freight"SortExpression="Freight"/>

</Columns>

</asp:GridView>

</ContentTemplate>

</atlas:UpdatePanel>

Codebehind:

protectedvoid GridView1_PageIndexChanging(object sender,GridViewPageEventArgs e)

{

GridView1.PageIndex = e.NewPageIndex;

BindGrid();

}


hello.

well, it looks ok to me.

there's one thing i don't understand: you've added a trigger to the panel and configured it against a button which is also placed inside the panel...

i've built a small page that is working ok here (i've built a struct to simulate the info that is passed as source of the grid). see if it works with your current configuration:

public struct Ship
{
private string _shipName;

public string ShipName
{
get { return _shipName; }
set { _shipName = value; }
}
private string _shipCountry;

public string ShipCountry
{
get { return _shipCountry; }
set { _shipCountry = value; }
}
private string _freight;

public string Freight
{
get { return _freight; }
set { _freight = value; }
}

public Ship( string shipName, string shipCountry, string freight )
{
_shipName = shipName;
_shipCountry = shipCountry;
_freight = freight;
}
}

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!this.IsPostBack )
{
BindGrid();
}
}

void BindGrid()
{
Ship [] shippes = new Ship[]{
new Ship( "1","1","1" ),
new Ship( "2","2","2" ),
new Ship( "3","3","3" )
};

GridView1.DataSource = shippes;
GridView1.DataBind();
}

protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{

GridView1.PageIndex = e.NewPageIndex;

BindGrid();

}

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
<atlas:UpdatePanel ID="EmpOrders" runat="server" Mode="Conditional">
<Triggers>
<atlas:ControlEventTrigger ControlID="Button1" EventName="Click"/>
</Triggers>
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Font-Italic="True" Text="Search"/><br/>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" PageSize="2" AllowPaging="True"
AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging" AllowSorting="True">
<Columns>
<asp:BoundField DataField="ShipName" HeaderText="Ship Name" SortExpression="ShipName"/>
<asp:BoundField DataField="ShipCountry" HeaderText="Country" SortExpression="Country"/>
<asp:BoundField DataField="Freight" HeaderText="Freight" SortExpression="Freight"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</atlas:UpdatePanel>
<%= DateTime.Now.ToString() %>
</form>
</body>
</html>

Are you doing custom paging? I'm asking because normally, the GridView control takes care of this automatically (as well the binding -- unlike in DataGrid) so that you don't even have to handle the event. This is assuming that your datasource can handle paging (DataSet does I believe).


hello guys, and yes, i think that he is using the asp.net 1.X binding instead of using the new data source controls...

Yes I′m handling the binding as with .NET v1.x


hello again.

Can you run the sample page i've presented in a previous post?

Luis, your example works fine. The only difference between your code and mine is that you use a Struct as your datagrid's datasource and I use a DataSet.

What do you think?


hello.

well, i think that using a dataset shouldn't make any difference. can you build a sample page that uses a dummy dataset to reproduce the problem and post it here?
I have the same problem using an SQLDatasource. Is it possible that it only work with dataset because with dataset you can generate XML. Maybe with SqlDatasource it doesn't generate Xml so Atlas on gridview with SqlDatasource will no work ?
Luis, I′m working on the dummy page. In the meantime, I noticed that having

EnablePartialRendering="true"

won't let me fire the paging, deleting etc. events

Do you have it set to true?


hello.

yes i have. i've introduced < in my previous post and i think that now you should be able to see everything.

Wednesday, March 21, 2012

partial Display of CalendarExtend Control

I am using CalendarExtend control on one of my webpage but for some reason it's not displayed correctly. When I click on imageButton to popup calendar control it display under textbox but It's partially displayed (missing Thursday,Fri, Sat).

All the below code is inside Table.

<asp:TextBoxID="txtPartNumber"runat="server"Width="181px"></asp:TextBox>
<imgsrc="Images/Calendar.png"alt="Calendar"id="ImgPartNumber"/>
<cc1:CalendarExtenderAnimated="true"CssClass="MyCalendar"ID="CEInstallationDate"PopupButtonID="ImgPartNumber"TargetControlID="txtPartNumber"runat="server">
</cc1:CalendarExtender>

.MyCalendar.ajax__calendar_container {
border:1pxsolid#646464;
filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr='steelblue',endColorStr='white');
color:blue;
width:250px;
}

Hi Bhavin,

I have tested your sample on my machine.It works pretty well on IE7 and on Firefox DXImageTransform.Microsoft.Gradient doesn't work but the issue you described above doesn't appear.

So I suspect that maybe your issue is caused on your system environment. Please upgrate your Ajax Control Toolkit to V10618 or V10920.

Hope this help.

Best regards,

Jonathan