Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Wednesday, March 21, 2012

ParserErrorException when Edit button on Datagrid pressed

I have a datagrid control wrapped in an UpdatePanel. There are Edit/Delete ImageButton's for each row. The first time I press the Edit butonn (setsEditItemIndex = -1) the ubiquitous Sys.Webforms.PageRequestManagerParserErrorException; The message from the server could not be parsed...

Subsequently, pressing the edit button prooduces the desired results.

Any ideas with this strange behavior are appreciated.

TIA

Hi,

Please refer to this:http://siderite.blogspot.com/2007/02/aspnet-ajax-and-responsewrite-or.html

It gives a full explanation of it. Hope this helps.

NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


I also face this kind of problem - 'Sys.WebForms.PageRequestManagerPerserErrorException:'. So far I
understand this happen when there is some unrecongnize html render or event occurs. I'm also not very clear.

But I solve the issue by set the attribute EnableEventValidation="false" in the ASPX page, where I place my
UpdatePanel.

Thanks
I also face this kind of problem - 'Sys.WebForms.PageRequestManagerPerserErrorException:'. So far I
understand this happen when there is some unrecongnize html render or event occurs. I'm also not very clear.

But I solve the issue by set the attribute EnableEventValidation="false" in the ASPX page, where I place my
UpdatePanel.

Thanks

partial postback does not occur but the whole page gets reloaded


Hello coders,

I got a problem with my updatepanel.
I have a dynamic datagrid with a delete button. When i press the delete button
the partial postback occurs. ALL THIS WORKS FINE.

However i also have a Textbox in the same datagrid.
When i change the value in the Textbox a callback is generated.
The partial postback does not occur but the whole page gets reloaded.
This is not what i want.

So what is the diference between these two?

I will post a simplified version of my code:

'------<asp:UpdatePanel ID="udpWinkelwagen" runat="server"> <ContentTemplate> <asp:PlaceHolder ID="phWinkelwagen" runat="server" ></asp:PlaceHolder> </ContentTemplate></asp:UpdatePanel>'------ dgWinkelwagen =New DataGrid dgWinkelwagen.AutoGenerateColumns =False dgWinkelwagen.ShowFooter =True dgWinkelwagen.DataSource = ds.Tables(0) ...'TextField tempCol =New TemplateColumn tempCol.HeaderText = myDB.LeesVeld(myDB.haalViewOp("web_WinkelwagenText","quantity", taal),"Text") tempCol.ItemTemplate =New DynamicItemTemplateTextBox(Me.Page, bestelnr, taal) dgWinkelwagen.Columns.Add(tempCol)'delete button strConrirm = myDB.LeesVeld(myDB.haalViewOp("web_WinkelwagenText","confirmDelete", taal),"omschrijving") tempCol =New TemplateColumn tempCol.ItemStyle.HorizontalAlign = HorizontalAlign.Center tempCol.HeaderText ="" tempCol.ItemTemplate =New DynamicItemTemplateDeleteButton(bestelnr, strConrirm,Me.Page) dgWinkelwagen.Columns.Add(tempCol) dgWinkelwagen.DataBind()' add to placeholder on page phWinkelwagen.Controls.Add(dgWinkelwagen)'------Public Class DynamicItemTemplateTextBoxImplements ITemplateDim ds, dsProcAs DataSetDim myDBAs DB =New DBDim myHulpAs HulpFuncties =New HulpFunctiesDim myOrbisAs OrbisTaskCentre =New OrbisTaskCentreDim myWebshopAs webshopFuncties =New webshopFunctiesDim taalAs String Dim btnSave, txtSave, strAlert, titel, omschrijvingAs String Dim artikel, bestelnr, errorTextAs String Dim myPageAs PageDim aantalAs Double Sub New(ByVal pAs Page,ByVal bestnrAs String,ByVal taalcodeAs String) myPage = p bestelnr = bestnr taal = taalcodeEnd Sub Public Sub InstantiateIn(ByVal containerAs Control)Implements ITemplate.InstantiateInDim txtAantalAs TextBox =New TextBox() txtAantal.AutoPostBack =True txtAantal.Width ="38" txtAantal.MaxLength ="4"AddHandler txtAantal.TextChanged,AddressOf Me.changeValue container.Controls.Add(txtAantal)End Sub Public Sub changeValue(ByVal senderAs Object,ByVal eAs EventArgs)CType(myPage.Master, masterMethods).updateCart()CType(myPage.Page, winkelwagenMethods).updateGrid()End SubEnd Class'------Public Class DynamicItemTemplateDeleteButtonImplements ITemplateDim artnr, txtAantal, btnDelete, strConfirm, omschrijving, strAlertAs String Dim myDbAs DB =New DBDim dsProcAs DataSetDim bestelnrAs Integer Dim mypageAs PageSub New(ByVal _bestelnrAs Integer,ByVal confirmAs String,ByVal _pageAs Page) strConfirm = confirm bestelnr = _bestelnr mypage = _pageEnd Sub Public Sub InstantiateIn(ByVal containerAs Control)Implements ITemplate.InstantiateInDim imgBtnDelAs ImageButton =New ImageButton() imgBtnDel.ImageUrl ="~/images/remove.gif"AddHandler imgBtnDel.Click,AddressOf Me.DeleteArtikel container.Controls.Add(imgBtnDel)End Sub Public Sub DeleteArtikel(ByVal senderAs Object,ByVal eAs ImageClickEventArgs) artnr =CType(CType(sender, ImageButton).Parent.Parent.Controls(1).Controls(0), Label).TextDim parameters1()As String = {bestelnr, artnr} dsProc = myDb.startProcedure("web_winkelwagen_artikel_delete", parameters1)CType(mypage.Master, masterMethods).updateCart()CType(mypage.Page, winkelwagenMethods).updateGrid()End SubEnd Class

hello.

can you builkd a simple demo page that reproduces the app and put it here so that we can simply copy/paste it into vs?