Showing posts with label implemented. Show all posts
Showing posts with label implemented. Show all posts

Monday, March 26, 2012

PageRequestManagerParserErrorException, is it due to web farm?

I implemented an ASP.NET 2.0 web application with the ASP.NET AJAX framework and the AJAX Control Toolkit. When I run it in my development pc, it works perfectly. But when it runs on a production server environment, which is a web farm, the following javascript error message prompts frequently on the browser:
Sys.WebForms.PageRequestManagerParserErrorException: This message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near '<!DOCTYPE html P'.
Anybody helps? It's my first project in my current company...

This problem is solved by adding a machinekey to the web.config.

Saturday, March 24, 2012

Paging and Sorting Problem with ASP.net AJAX

Hi,
I have created 3 level hierarchial grid using datagrid control ofasp.net andasp.net ajax v1.0.

In this I have implemented custom paging with datareaders.

If my second level grid contains only one record, my thirdlevel grid paging and sorting works fine.But if my second level grid contains more than one record, my third level grid paging and sorting stops functioning

Similarly if my first level grid contains one record, paging and sorting of records in second level grid works fine. If it contains more than one record, paging and sorting of records in second level grid stops functioning.

Without AJAX, the code is working perfectly.
Can anybody out here, figure out what is the problem and help me in fixing this issue.

Thanks in Advance

Anu

share us your code please!

Hi,

Please have my source code of it,I have connection string in web.config.I am sending you the aspx page and aspx.vb(code behind page)

This is my aspx Page

-----------

<%@. Page Language="VB" MaintainScrollPositionOnPostback="true" AutoEventWireup="false" CodeFile="HierGrid.aspx.vb" Inherits="HierGrid" %>

<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Contract Customer List</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="http://links.10026.com/?link=Includes/Style Sheet/hcms_jnj.css" rel="stylesheet" type="text/css">
</head>
<body>
<form id="form1" runat="server">

<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" height="32">

<tr>
<td height="34" align="center" valign="middle" class="pagetitle" width="852">
<u>Contract - Customer List</u></td>
</tr>
</table>

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<DIV>
<asp:UpdatePanel ID="dgParentPanel" runat="server" UpdateMode=always>
<ContentTemplate>
<asp:DataGrid ID="dgParent" runat="server" CssClass ="grid_body" AllowCustomPaging="True" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" PageSize="10" PagerStyle-Mode="NumericPages" Width="836px">
<ItemStyle CssClass="grid_body"></ItemStyle>
<HeaderStyle CssClass="grid_header"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:ImageButton ID="imgBtnParent" ImageUrl="~/Images/plus.gif" CommandName="Expand" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="CONTR_ID" SortExpression="CONTR_ID" HeaderText="Contract ID">
<ItemStyle HorizontalAlign="Left" BorderStyle =Solid BorderColor="White" Width="120px" />
<HeaderStyle Width="130px" ForeColor="Blue" />
</asp:BoundColumn>
<asp:BoundColumn DataField="CONTR_NO" SortExpression="CONTR_NO" HeaderText="Contract Number">
<ItemStyle HorizontalAlign="Left" BorderStyle =Solid BorderColor="White" Width="120px" />
<HeaderStyle Width="120px" ForeColor="Blue" />
</asp:BoundColumn>
<asp:BoundColumn DataField="CONTR_NM" SortExpression="CONTR_NM" HeaderText="Contract Name">
<ItemStyle HorizontalAlign="Left" BorderStyle =Solid BorderColor="White" Width="250px" />
<HeaderStyle Width="250px" ForeColor="Blue" />
</asp:BoundColumn>
<asp:BoundColumn DataField="CONTR_ADDR" SortExpression="CONTR_ADDR" HeaderText="Address">
<ItemStyle HorizontalAlign="Left" BorderStyle =Solid BorderColor="White" Width="250px" />
<HeaderStyle Width="250px" ForeColor="Blue" />
</asp:BoundColumn>
<asp:BoundColumn DataField="EFFTV_STRT_DT" SortExpression="EFFTV_STRT_DT" HeaderText="Effective Start Date">
<ItemStyle HorizontalAlign="Left" BorderStyle =Solid BorderColor="White" Width="10px" />
<HeaderStyle Width="100px" ForeColor="Blue" />
</asp:BoundColumn>
<asp:BoundColumn DataField="EFFTV_END_DT" SortExpression="EFFTV_END_DT" HeaderText="Effective End Date">
<ItemStyle HorizontalAlign="Left" BorderStyle =Solid BorderColor="White" Width="10px" />
<HeaderStyle Width="100px" ForeColor="Blue" />
</asp:BoundColumn>
<asp:TemplateColumn >
<ItemTemplate>
<asp:UpdatePanel ID="dgChild1Panel" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:PlaceHolder ID="phParent" Visible="false" runat="server" >
</td></tr>
<tr><td colspan="7">
<asp:DataGrid ID="dgChild1" OnPageIndexChanged = "dgChild1_PageIndexChanged" OnSortCommand= "dgChild1_SortCommand" FooterStyle-CssClass ="grid_body" AllowPaging ="true" AllowCustomPaging = "true" BorderStyle = "Solid" BorderWidth="1px" BorderColor ="white" FooterStyle-Height="1px" PagerStyle-Mode="NumericPages" Width="1200px" AllowSorting="True" OnItemCommand = "dgChild1_ItemCommand" CssClass ="grid_body" ShowFooter="True" AutoGenerateColumns="false" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">
<ItemStyle CssClass="grid_body" ></ItemStyle>
<HeaderStyle CssClass="grid_header" BorderStyle =Solid BorderColor =white ></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:ImageButton BorderStyle =Solid BorderColor =white ID="imgBtnChild" CommandName="ExpChild1" ImageUrl="~/Images/plus.gif" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn Visible=false ItemStyle-BorderColor =white ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "" DataField="parnt_intract_no" SortExpression="parnt_intract_no" HeaderText="parnt_intract_no" HeaderStyle-ForeColor ="Blue" ></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "100px" DataField="INTRACT_NO" SortExpression="INTRACT_NO" HeaderText="Interact Number" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "200px" DataField="CUST_NM" SortExpression="CUST_NM" HeaderText="Customer Name" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "200px" DataField="CUST_ADDR" SortExpression="CUST_ADDR" HeaderText="Customer Address" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="Relshp_strt_dt" SortExpression="Relshp_strt_dt" HeaderText="Contract Relationship Eff. Date" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="Relshp_end_dt" SortExpression="Relshp_end_dt" HeaderText="Contract Relationship Exp. Date" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="intract_cot_cd" SortExpression="intract_cot_cd" HeaderText="COT Code" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="cust_typ" SortExpression="cust_typ" HeaderText="Customer Type" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="DDD_NO" SortExpression="DDD_NO" HeaderText="DDD Number" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="DEA_NO" SortExpression="DEA_NO" HeaderText="DEA Number" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="PHS_ELGBLT" SortExpression="PHS_ELGBLT" HeaderText="PHS Eligible" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "80px" DataField="NCI_ACCT" SortExpression="NCI_ACCT" HeaderText="NCI Account" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:TemplateColumn >
<ItemTemplate>
sdgsdgs
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn >
<ItemTemplate>
<asp:UpdatePanel ID="dgChild2Panel" runat="server" UpdateMode=always>
<ContentTemplate>
<asp:PlaceHolder ID="phChild1" Visible="false" runat="server" >
</td></tr>
<tr> <td width="7"> </td>
<td colspan="12">
<asp:DataGrid ID="dgChild2" BorderStyle = "Solid" BorderWidth="1px" BorderColor ="white" Width="1000px" FooterStyle-Height="1px" PagerStyle-Mode="NumericPages" AllowCustomPaging="True" AllowPaging="True" AllowSorting="True" ShowFooter="True" AutoGenerateColumns="false" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" CssClass ="grid_body" >
<ItemStyle BorderStyle =Solid BorderWidth =1px CssClass="grid_body"></ItemStyle>
<HeaderStyle BorderStyle =Solid BorderWidth =1px CssClass="grid_header"></HeaderStyle>
<Columns>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" ItemStyle-Width = "120px" DataField="INTRACT_NO" SortExpression="INTRACT_NO" HeaderText="Ship To Interact" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "300px" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" DataField="CUST_NM" SortExpression="CUST_NM" HeaderText="Name" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "300px" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" DataField="SHIPTO_ADDR" SortExpression="SHIPTO_ADDR" HeaderText="Address" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "200px" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" DataField="SHP_TYP" SortExpression="SHP_TYP" HeaderText="Ship To Type" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "100px" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" DataField="COT_CD" SortExpression="COT_CD" HeaderText="COT Code" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "100px" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" DataField="DDD_NO" SortExpression="DDD_NO" HeaderText="DDD Number" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
<asp:BoundColumn HeaderStyle-BorderStyle = Solid HeaderStyle-BorderColor =white HeaderStyle-BorderWidth ="1px" ItemStyle-BorderColor =white ItemStyle-HorizontalAlign= "left" ItemStyle-Width = "100px" ItemStyle-BorderStyle =Solid ItemStyle-BorderWidth ="1px" DataField="DEA_NO" SortExpression="DEA_NO" HeaderText="DEA Number" HeaderStyle-ForeColor ="Blue"></asp:BoundColumn>
</Columns>
<PagerStyle Height ="1px" NextPageText="Next &gt;" PrevPageText="&lt; Prev" CssClass="pager" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Height ="1px" NextPageText="Next &gt;" PrevPageText="&lt; Prev" CssClass="pager" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
<HeaderStyle Width="1px" />
</asp:TemplateColumn>
</Columns>
<PagerStyle NextPageText="Next &gt;" PrevPageText="&lt; Prev" CssClass="pager" Mode="NumericPages"></PagerStyle>
</asp:DataGrid>
</ContentTemplate>
</asp:UpdatePanel>

</DIV>

<table align="center" width="100%" >
<tr>
<td width="70px" ></td>
<td align="left">Rows per Page: <asp:TextBox id="ROWSPERPAGE" CssClass="field1" runat="server" AutoPostBack="False"></asp:TextBox>
<asp:Button id="CHANGEROWSPERPAGE" runat="server" CssClass="submit" Text="Change"></asp:Button>
</td>
</tr>
</table>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
Loading...
</ProgressTemplate>
</asp:UpdateProgress>

</form>
</body>
</html>

This is my code behind page

--------------

#Region "Imported Namespaces"
Imports System
Imports System.Collections
Imports System.Data
Imports System.Data.OracleClient
Imports System.Data.OracleClient.OracleType
Imports System.Web
Imports System.Drawing
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Configuration
#End Region

Partial Class HierGrid
Inherits System.Web.UI.Page
#Region "Class level Variables"
Protected OracleConn As OracleConnection
Protected OracleCmd As OracleCommand
Protected OracleDR As OracleDataReader
Protected OracleReader As OracleDataReader
Dim StrSQL As String
Dim modifiedOrderby As String
Dim orderby As String
Dim direction As String
Dim pageindex As String
Dim maximumrows As Integer
Dim vartemp As String
Dim strParentId As String
Dim strInteractId As String

#End Region

#Region "Properties"
Protected Property dgParent_CurrentSortColumn() As String
Get
If Not ViewState("dgParentSortColumn") Is Nothing Then
Return ViewState("dgParentSortColumn").ToString
Else
ViewState("dgParentSortColumn") = "CONTR_ID"
Return "CONTR_ID"
End If
End Get
Set(ByVal value As String)
ViewState("dgParentSortColumn") = value
End Set
End Property

Protected Property dgParent_CurrentSortDirection() As String
Get

If Not ViewState("dgParentSortDirection") Is Nothing Then
Return ViewState("dgParentSortDirection").ToString
Else
ViewState("dgParentSortDirection") = "ASC"
Return "ASC"
End If
End Get
Set(ByVal value As String)
ViewState("dgParentSortDirection") = value
End Set
End Property


Protected Property dgChild1_CurrentSortColumn() As String
Get
If Not ViewState("dgChild1SortColumn") Is Nothing Then
Return ViewState("dgChild1SortColumn").ToString
Else
ViewState("dgChild1SortColumn") = "INTRACT_NO"
Return "INTRACT_NO"
End If
End Get
Set(ByVal value As String)
ViewState("dgChild1SortColumn") = value
End Set
End Property

Protected Property dgChild1_CurrentSortDirection() As String
Get

If Not ViewState("dgChild1SortDirection") Is Nothing Then
Return ViewState("dgChild1SortDirection").ToString
Else
ViewState("dgChild1SortDirection") = "ASC"
Return "ASC"
End If
End Get
Set(ByVal value As String)
ViewState("dgChild1SortDirection") = value
End Set
End Property

Protected Property dgChild2_CurrentSortColumn() As String
Get
If Not ViewState("dgChild2SortColumn") Is Nothing Then
Return ViewState("dgChild2SortColumn").ToString
Else
ViewState("dgChild2SortColumn") = "INTRACT_NO"
Return "INTRACT_NO"
End If
End Get
Set(ByVal value As String)
ViewState("dgChild2SortColumn") = value
End Set
End Property

Protected Property dgChild2_CurrentSortDirection() As String
Get

If Not ViewState("dgChild2SortDirection") Is Nothing Then
Return ViewState("dgChild2SortDirection").ToString
Else
ViewState("dgChild2SortDirection") = "ASC"
Return "ASC"
End If
End Get
Set(ByVal value As String)
ViewState("dgChild2SortDirection") = value
End Set
End Property
#End Region

#Region "Pagelevel Events"
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
StrSQL = "SELECT COUNT(1) AS C FROM RCS_CONTR"
GetTotalRecords(StrSQL, dgParent)
dgParent_CurrentSortColumn = "CONTR_ID"
dgParent_CurrentSortDirection = "ASC"
dgParent.CurrentPageIndex = 0
dgParent.PageSize = 10
ActualPagedData(dgParent)
ROWSPERPAGE.Text = dgParent.PageSize.ToString()

End If
End Sub
#End Region

#Region "User Defined Methods"
Private Sub GetTotalRecords(ByVal StrSQL As String, ByVal ogrid As DataGrid)
Try

OracleConn = New OracleConnection(ConfigurationManager.AppSettings("ConnectionString").ToString)
Size=3;Max Pool Size=50;Connection Lifetime=7200;")
OracleConn.Open()
OracleCmd = New OracleCommand(StrSQL, OracleConn)
OracleCmd.CommandType = CommandType.Text
OracleDR = OracleCmd.ExecuteReader
OracleDR.Read()
ogrid.VirtualItemCount = CType(OracleDR.GetDecimal(0), Integer)

Catch ORCLExec As OracleException
Response.Write(ORCLExec.Message)

Finally
If Not OracleDR Is Nothing Then
OracleDR.Close()
End If
If Not OracleCmd Is Nothing Then
OracleCmd.Dispose()
End If
If Not OracleConn Is Nothing Then
OracleConn.Close()
End If
End Try
End Sub

Private Sub ActualPagedData(ByVal oGrid As DataGrid)

Dim modifiedOrderby As String
Dim SQLString, SQLCount As String

Try
Dim Lowlmt As Decimal = (1 + oGrid.CurrentPageIndex * oGrid.PageSize + oGrid.PageSize)
Dim Highlmt As Decimal = (1 + oGrid.CurrentPageIndex * oGrid.PageSize)
SQLString = String.Empty
If oGrid.UniqueID = dgParent.UniqueID Then
modifiedOrderby = dgParent_CurrentSortColumn & " " & dgParent_CurrentSortDirection

SQLString = " SELECT CONTR_ID,CONTR_NO,CONTR_NM,CONTR_ADDR,TO_CHAR(EFFTV_STRT_DT,'MM/DD/YYYY') AS EFFTV_STRT_DT,TO_CHAR(EFFTV_END_DT,'MM/DD/YYYY') AS EFFTV_END_DT " & _
" FROM (SELECT P.*, " & _
" ROWNUM RNUM " & _
" FROM (SELECT A.CONTR_ID,A.CONTR_NO,A.CONTR_NM, B.ADDR1||','||B.CITY||','||B.STT_ABBRD||','||B.ZIP AS CONTR_ADDR,A.EFFTV_STRT_DT,A.EFFTV_END_DT " & _
" FROM RCS_CONTR A, hcms_addr B WHERE " & _
" A.ADDR_ID = B.ADDR_ID (+) " & _
" ORDER BY " & modifiedOrderby & ") P " & _
" WHERE ROWNUM < " & Lowlmt & ")" & _
" WHERE RNUM >= " & Highlmt & ""

ElseIf oGrid.UniqueID = dgChild1.UniqueID Then
' oGrid.Height = 1000
oGrid.CurrentPageIndex = CType(Session("child1_pageindex"), Integer)
modifiedOrderby = dgChild1_CurrentSortColumn & " " & dgChild1_CurrentSortDirection
SQLString = " SELECT PARNT_INTRACT_NO,INTRACT_NO,CUST_NM,CUST_ADDR,CUST_TYP,DEA_NO,DECODE(PHS_ELGBLT,'Y','YES','N','NO') AS PHS_ELGBLT,TO_CHAR(RELSHP_STRT_DT,'MM/DD/YYYY') AS RELSHP_STRT_DT,TO_CHAR(RELSHP_END_DT,'MM/DD/YYYY') AS RELSHP_END_DT,INTRACT_COT_CD,DDD_NO,DECODE(NCI_ACCT,'Y','YES','N','NO') AS NCI_ACCT " & _
" FROM (SELECT P.*, " & _
" ROWNUM RNUM " & _
" FROM (SELECT A.PARNT_INTRACT_NO,A.INTRACT_COT_CD,D.PARM_VAL AS CUST_TYP , A.INTRACT_NO,A.CUST_NM,C.ADDR1||','||C.CITY||','||C.STT_ABBRD||','||C.ZIP AS CUST_ADDR ,A.BIO_ID,A.IN_PATNT_DEA AS DEA_NO,B.PHS_ELGBLT,B.RELSHP_STRT_DT,B.RELSHP_END_DT,DDD_NO,B.NCI_ACCT " & _
" FROM RCS_CUST A,RCS_CONTR_CUST_MAP B,hcms_addr C,RCS_LKUP D " & _
" WHERE A.INTRACT_NO = B.INTRACT_NO AND A.ADDR_ID = C.ADDR_ID(+) AND " & _
" A.CUST_TYP = D.PARM_ID (+) AND UPPER(D.PARM_NM) = 'CUSTOMER TYPE' AND "
If Session("ContractID") <> "" Then SQLString = SQLString & " B.CONTR_ID = '" & Trim(Session("ContractID")) & "'"
SQLString = SQLString & " ORDER BY " & modifiedOrderby & ") P" & _
" WHERE ROWNUM < " & Lowlmt & ")" & _
" WHERE RNUM >= " & Highlmt & ""
SQLCount = " SELECT count(*) " & _
" FROM (SELECT P.*, " & _
" ROWNUM RNUM " & _
" FROM (SELECT A.PARNT_INTRACT_NO,A.INTRACT_COT_CD,D.PARM_VAL AS CUST_TYP , A.INTRACT_NO,A.CUST_NM,C.ADDR1||','||C.CITY||','||C.STT_ABBRD||','||C.ZIP AS CUST_ADDR ,A.BIO_ID,A.IN_PATNT_DEA AS DEA_NO,B.PHS_ELGBLT,TO_CHAR(B.RELSHP_STRT_DT,'MM/DD/YYYY'),TO_CHAR(B.RELSHP_END_DT,'MM/DD/YYYY'),DDD_NO,B.NCI_ACCT " & _
" FROM RCS_CUST A,RCS_CONTR_CUST_MAP B,hcms_addr C,RCS_LKUP D " & _
" WHERE A.INTRACT_NO = B.INTRACT_NO AND A.ADDR_ID = C.ADDR_ID(+) AND " & _
" A.CUST_TYP = D.PARM_ID (+) AND UPPER(D.PARM_NM) = 'CUSTOMER TYPE' AND "
If Session("ContractID") <> "" Then SQLCount = SQLCount & " B.CONTR_ID = '" & Trim(Session("ContractID")) & "'"
SQLCount = SQLCount & " ORDER BY " & modifiedOrderby & ") P " & ")"
Try
OracleConn = New OracleConnection(ConfigurationManager.AppSettings("ConnectionString").ToString)
Pool Size=3;Max Pool Size=50;Connection Lifetime=7200;")
OracleConn.Open()
OracleCmd = New OracleCommand(SQLCount, OracleConn)
OracleCmd.CommandType = CommandType.Text
OracleReader = OracleCmd.ExecuteReader
OracleReader.Read()
oGrid.VirtualItemCount = CType(OracleReader.GetDecimal(0), Integer)
Catch OraEx As OracleException
Response.Write(OraEx.Message)
Finally
If Not OracleReader Is Nothing Then
OracleReader.Dispose()
End If
If Not OracleCmd Is Nothing Then
OracleCmd.Dispose()
End If
If Not OracleConn Is Nothing Then
OracleConn.Close()
End If
End Try
ElseIf oGrid.UniqueID = dgChild2.UniqueID Then
modifiedOrderby = dgChild2_CurrentSortColumn & " " & dgChild2_CurrentSortDirection
SQLString = " SELECT INTRACT_NO, CUST_NM , SHIPTO_ADDR ,SHP_TYP,COT_CD,DEA_NO ,DDD_NO " & _
" FROM (SELECT P.*, " & _
" ROWNUM RNUM " & _
" FROM (SELECT A.INTRACT_NO,A.CUST_NM,B.ADDR1||','||B.CITY||','||B.STT_ABBRD||','||B.ZIP AS SHIPTO_ADDR,A.INTRACT_COT_CD AS COT_CD,A.IN_PATNT_DEA AS DEA_NO,A.DDD_NO,C.PARM_VAL AS SHP_TYP FROM RCS_CUST A ,hcms_addr B , RCS_LKUP C WHERE " & _
" A.ADDR_ID = B.ADDR_ID (+) " & _
" AND A.SHP_TO_TYP = C.PARM_ID (+) "
If Session("InteractID") <> "" Then SQLString = SQLString & " and parnt_intract_no = '" & Trim(Session("InteractID")) & "'"
SQLString = SQLString & " ORDER BY " & modifiedOrderby & ") P " & _
" WHERE ROWNUM < " & Lowlmt & ")" & _
" WHERE RNUM >= " & Highlmt & ""

SQLCount = " SELECT count(*) " & _
" FROM (SELECT P.*, " & _
" ROWNUM RNUM " & _
" FROM (SELECT A.INTRACT_NO,A.CUST_NM,B.ADDR1||','||B.CITY||','||B.STT_ABBRD||','||B.ZIP AS SHIPTO_ADDR,A.INTRACT_COT_CD AS COT_CD,A.IN_PATNT_DEA AS DEA_NO,A.DDD_NO,C.PARM_VAL AS SHP_TYP FROM RCS_CUST A ,hcms_addr B , RCS_LKUP C WHERE " & _
" A.ADDR_ID = B.ADDR_ID (+) " & _
" AND A.SHP_TO_TYP = C.PARM_ID (+) "
If Session("InteractID") <> "" Then SQLCount = SQLCount & " and parnt_intract_no = '" & Trim(Session("InteractID")) & "'"
SQLCount = SQLCount & " ORDER BY " & modifiedOrderby & ") P " & ")"

Try
OracleConn = New OracleConnection(ConfigurationManager.AppSettings("ConnectionString").ToString)
Pool Size=3;Max Pool Size=50;Connection Lifetime=7200;")
OracleConn.Open()
OracleCmd = New OracleCommand(SQLCount, OracleConn)
OracleCmd.CommandType = CommandType.Text
OracleReader = OracleCmd.ExecuteReader
OracleReader.Read()
oGrid.VirtualItemCount = CType(OracleReader.GetDecimal(0), Integer)
Catch OraEx As OracleException
Response.Write(OraEx.Message)
Finally
If Not OracleReader Is Nothing Then
OracleReader.Dispose()
End If
If Not OracleCmd Is Nothing Then
OracleCmd.Dispose()
End If
If Not OracleConn Is Nothing Then
OracleConn.Close()
End If
End Try
End If
OracleConn = New OracleConnection(ConfigurationManager.AppSettings("ConnectionString").ToString)
OracleConn.Open()
OracleCmd = New OracleCommand(SQLString, OracleConn)
OracleCmd.CommandType = CommandType.Text
oGrid.DataSource = OracleCmd.ExecuteReader
oGrid.DataBind()


Catch OraEx As OracleException
Response.Write(OraEx.Message)
Finally
If Not OracleCmd Is Nothing Then
OracleCmd.Dispose()
End If
If Not OracleConn Is Nothing Then
OracleConn.Close()
End If
End Try
End Sub

Protected Sub CHANGEROWSPERPAGE_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CHANGEROWSPERPAGE.Click

Try

Session("ContractID") = ""
Dim Lowlmt As Decimal = (1 + dgParent.CurrentPageIndex * dgParent.PageSize + dgParent.PageSize)
Dim Highlmt As Decimal = (1 + dgParent.CurrentPageIndex * dgParent.PageSize)
Dim newPageIndex, newPageSize As Integer
newPageSize = CType(ROWSPERPAGE.Text, Integer)
newPageIndex = CType((Highlmt / newPageSize), Integer)
dgParent.CurrentPageIndex = newPageIndex
dgParent.PageSize = newPageSize
ActualPagedData(dgParent)
Catch ex As Exception
Response.Write("Please enter a valid integer to change the number of rows per page.")
End Try
End Sub
#End Region

#Region "ParentDataGrid Event Handlers"

Protected Sub dgParent_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgParent.ItemCommand
If e.CommandName = "Expand" Then
Dim imgBtn As ImageButton
Dim pHolder As PlaceHolder

'Before expanding, collapse previously opened child grid
Dim dgItem As DataGridItem
For Each dgItem In dgParent.Items
If dgItem.ItemIndex = ViewState("PrvIndex") And dgItem.ItemIndex <> e.Item.ItemIndex Then
imgBtn = dgItem.Cells(0).FindControl("imgBtnParent")
If imgBtn.ImageUrl = "~/Images/minus.gif" Then
imgBtn.ImageUrl = "~/Images/plus.gif"
pHolder = CType(dgItem.FindControl("phParent"), PlaceHolder)
pHolder.Visible = Not pHolder.Visible
End If
Exit For
End If
Next
' Get the contract id for which to display customers
strParentId = e.Item.Cells(1).Text
Session("ContractID") = strParentId

imgBtn = e.Item.Cells(0).FindControl("imgBtnParent")
If imgBtn.ImageUrl = "~/Images/plus.gif" Then
imgBtn.ImageUrl = "~/Images/minus.gif"

Else
imgBtn.ImageUrl = "~/Images/plus.gif"
End If
Dim exp As PlaceHolder
exp = e.Item.Cells(5).FindControl("phParent")
exp.Visible = Not exp.Visible
If exp.Visible = True Then
dgChild1.CurrentPageIndex = 0
ActualPagedData(dgParent)
End If
'Get the previous selected index in order to collapse the previous DataGrid
ViewState("PrvIndex") = e.Item.ItemIndex

End If
End Sub

Protected Sub dgParent_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgParent.ItemDataBound
' It will be called on binding each and every row of the datagrid to datasource

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

If e.Item.Cells(1).Text.Equals(Session("ContractID")) Then
Dim imgBtn As ImageButton
imgBtn = e.Item.Cells(0).FindControl("imgBtnParent")
imgBtn.ImageUrl = "~/Images/minus.gif"
Dim exp As PlaceHolder
exp = e.Item.Cells(5).FindControl("phParent")
exp.Visible = True
dgChild1.PageSize = CType(ROWSPERPAGE.Text, Integer)
'Session("InteractID") = ""
ActualPagedData(dgChild1)
End If
End If
End Sub

Protected Sub dgParent_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgParent.PageIndexChanged
dgParent.CurrentPageIndex = e.NewPageIndex
Session("ContractID") = ""
ActualPagedData(dgParent)
End Sub

Protected Sub dgParent_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles dgParent.SortCommand
' Dim direction As String

'Check if this is the second time the same column name is selected (this means we need to sort descending)
' Otherwise, the sort should be done ascending since this is a new column (compared to the one saved in the
' view state) that was selected.
If (dgParent_CurrentSortDirection = "ASC" And dgParent_CurrentSortColumn = e.SortExpression) Then
dgParent_CurrentSortDirection = "DESC"
Else
dgParent_CurrentSortDirection = "ASC"
End If
' Remember what column the data is sorted by.
dgParent_CurrentSortColumn = e.SortExpression
Session("ContractID") = ""
dgParent.CurrentPageIndex = 0
ActualPagedData(dgParent)
End Sub
#End Region

#Region "Second level Grid Event Handlers"

Protected Sub dgChild1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
If e.CommandName = "ExpChild1" Then
Dim imgBtnChild As ImageButton
Dim pHChild As PlaceHolder

Dim dgItem As DataGridItem

Dim dgChild As DataGrid
Dim dgItemChild As DataGridItem

For Each dgItem In dgParent.Items
dgChild = CType(dgItem.FindControl("dgChild1"), DataGrid)

For Each dgItemChild In dgChild.Items
If dgItemChild.ItemIndex = ViewState("prvChIndex") And dgItemChild.ItemIndex <> e.Item.ItemIndex Then
imgBtnChild = dgItemChild.Cells(0).FindControl("imgBtnChild")
If imgBtnChild.ImageUrl = "~/Images/minus.gif" Then
imgBtnChild.ImageUrl = "~/Images/plus.gif"
pHChild = dgItemChild.Cells(2).FindControl("pHChild1")
pHChild.Visible = Not pHChild.Visible
End If
Exit For
End If
Next
Next


strInteractId = e.Item.Cells(1).Text
Session("InteractID") = strInteractId

imgBtnChild = e.Item.Cells(0).FindControl("imgBtnChild")
If imgBtnChild.ImageUrl = "~/Images/plus.gif" Then
imgBtnChild.ImageUrl = "~/Images/minus.gif"
Else
imgBtnChild.ImageUrl = "~/Images/plus.gif"
End If

pHChild = e.Item.Cells(2).FindControl("phChild1")
pHChild.Visible = Not pHChild.Visible

If pHChild.Visible = True Then
dgChild2.CurrentPageIndex = 0
'ActualPagedData(dgChild1)
ActualPagedData(dgParent)
End If

ViewState("prvChIndex") = e.Item.ItemIndex
'pHChild.Visible = True

End If
End Sub

Protected Sub dgChild1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgChild1.Init

End Sub

Protected Sub dgChild1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgChild1.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
If e.Item.Cells(1).Text.Equals(Session("InteractID")) Then
Dim imgBtn As ImageButton
imgBtn = e.Item.Cells(0).FindControl("imgBtnChild")
imgBtn.ImageUrl = "~/Images/minus.gif"
Dim exp As PlaceHolder
exp = e.Item.Cells(5).FindControl("phChild1")
exp.Visible = True
' dgChild2.PageSize = CType(ROWSPERPAGE.Text, Integer)
dgChild2.PageSize = 1
ActualPagedData(dgChild2)
End If
End If
End Sub

Protected Sub dgChild1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)
Dim dgchild As New DataGrid
dgChild1.CurrentPageIndex = e.NewPageIndex
Session("child1_pageindex") = e.NewPageIndex
dgChild1.PageSize = CType(ROWSPERPAGE.Text, Integer)
Session("InteractID") = ""
ActualPagedData(dgChild1)
End Sub

Protected Sub dgChild1_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs)
'Check if this is the second time the same column name is selected (this means we need to sort descending)
' Otherwise, the sort should be done ascending since this is a new column (compared to the one saved in the
' view state) that was selected.
If (dgChild1_CurrentSortDirection = "ASC" And dgChild1_CurrentSortColumn = e.SortExpression) Then
dgChild1_CurrentSortDirection = "DESC"
Else
dgChild1_CurrentSortDirection = "ASC"
End If
' Remember what column the data is sorted by.
dgChild1_CurrentSortColumn = e.SortExpression

'Reselect the set of data to show. Note that the page index is reset to 0.
dgChild1.CurrentPageIndex = 0
Session("InteractID") = ""

ActualPagedData(dgChild1)

End Sub
#End Region

#Region "Third level Grid Event Handlers"
Protected Sub dgChild2_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles dgChild2.SortCommand
'Check if this is the second time the same column name is selected (this means we need to sort descending)
' Otherwise, the sort should be done ascending since this is a new column (compared to the one saved in the
' view state) that was selected.
If (dgChild2_CurrentSortDirection = "ASC" And dgChild2_CurrentSortColumn = e.SortExpression) Then
dgChild2_CurrentSortDirection = "DESC"
Else
dgChild2_CurrentSortDirection = "ASC"
End If
' Remember what column the data is sorted by.
dgChild2_CurrentSortColumn = e.SortExpression
' Make sure the page remembers the sorting direction.
'Reselect the set of data to show. Note that the page index is reset to 0.
dgChild2.CurrentPageIndex = 0
ActualPagedData(dgChild2)
End Sub

Protected Sub dgChild2_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgChild2.ItemDataBound

End Sub

Protected Sub dgChild2_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgChild2.PageIndexChanged
dgChild2.CurrentPageIndex = e.NewPageIndex
ActualPagedData(dgChild2)
End Sub

#End Region

End Class

Paging in GridView gets Object Expected Error

I have a grid in an update panel that gets databound at runtime (to index server results). I have implemented paging and it works without atlas. As soon as I place that grid in update panel, paging stops working. All I get is a javascript error saying "line 1 :Object Requiered".

I have tried debugging it but on paging, it doesn't event get to the server.

thanks

Hi Biren,

Have you tried this with the April CTP of Atlas that was released earlier this week?

If it's still a problem, can you please provide some more details on your scenario so that we can investigate?

Thanks,

Eilon


I have done it and it works for me. Object required is a pretty generic error just as the "Object reference not set to an..." in .Net. It could be because of wrong syntax in javascript or html that you might have on the page.

If you don't mind pasting the code on the forum please do so we can look at it.


Just tried it and same error.

here is the code:

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Index.aspx.vb" Inherits="Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Search</title>
<link href="http://links.10026.com/?link=Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<atlas:ScriptManager EnablePartialRendering="true" ID="atlas1" runat="server" EnableViewState="true" />
<form id="frm1" runat="server">

<atlas:UpdateProgress ID="up11" runat="server" >
<ProgressTemplate >
<table>
<tr>
<th style="color:red">Please wait while your serach results are calculated...</th>
</tr>
<tr>
<td>
<img src="http://pics.10026.com/?src=images/spinner.gif" /></td>
</tr>
</table>

</ProgressTemplate>
</atlas:UpdateProgress>
<atlas:UpdatePanel ID="up1" Mode="conditional" runat="server" >
<ContentTemplate >



<table>
<tr>
<th>A word or phrase in the file: </th><td><asp:TextBox ID="txtsearch" runat="server" /></td>
</tr>
<tr>
<th>All or part of filename: </th><td><asp:TextBox ID="txtfilename" runat="server" /></td>
</tr>
<tr>
<th>When was it modified?:</th>
<td>
<asp:DropDownList ID="lstDuration" runat="server">
<asp:ListItem Text="Don't remember" Value="0" />
<asp:ListItem Text="Within the last week" Value="7" />
<asp:ListItem Text="Past Month" Value="30" />
<asp:ListItem Text="Within the past year" Value="365" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2"><asp:Button ID="btnSubmit" runat="server" Text="Search" /></td>
</tr>
</table>

<asp:GridView ID="grdResults" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" AllowSorting="True" AllowPaging="True" PageSize="2" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Document Information">
<ItemTemplate>
<p>
<a href="http://links.10026.com/?link=<%# DataBinder.Eval(Container, "DataItem.path")%>">
<%# DataBinder.Eval(Container, "DataItem.Path")%>
</a>
<br />
<i>Last modified:
<%# DataBinder.Eval(Container, "DataItem.Write")%>
</i>
<br />
</p>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>

</ContentTemplate>

</atlas:UpdatePanel>
</form>
</body>
</html>

Code behind:

Partial Class Index
Inherits System.Web.UI.Page

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click


' Bind DataGrid to the DataSet. DataGrid is the ID for the
' DataGrid control in the HTML section.
Dim source As New DataView(createDS.Tables(0))
grdResults.DataSource = source
grdResults.DataBind()

End Sub
Private Function createDS() As DataSet
Dim cnnOledb As New OleDb.OleDbConnection
Dim strQuery As String

Dim critstr As String = "(contains(filename,'.doc OR .xls OR .ppt OR .asp OR .aspx OR .txt'))"

If txtsearch.Text.Length <> 0 Then
critstr += " AND (contains(contents,'" + condition(txtsearch.Text) + "'))"
End If


strQuery = "Select DocTitle,Filename,VPath,Rank,Characterization,Write,path from SCOPE() where " + critstr + " order by write desc"

Dim connString As String = "Provider=MSIDXS;Data Source='o drive'"

Dim cn As New System.Data.OleDb.OleDbConnection(connString)
Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)
Dim objDS As New DataSet

cmd.Fill(objDS)

Return objDS
End Function

Function condition(ByVal srchstr As String) As String
Dim arr As String() = srchstr.Split(" ")
For i As Integer = 0 To arr.Length - 1
Dim str1 As String = arr(i)
If str1 <> "AND" And str1 <> "OR" And str1 <> "NOT" Then
arr(i) = "\" + str1 + "\"
End If
Next
Return String.Join(" AND ", arr)
End Function


Sub grdResults_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdResults.PageIndexChanging
grdResults.PageIndex = e.NewPageIndex
Dim source As New DataView(createDS.Tables(0))
grdResults.DataSource = source
grdResults.DataBind()

End Sub
End Class


Hi again,

I tried this out and I'm getting the same error. This turns out to be a known bug in the April CTP of Atlas. To work around it, add this code to your Page's Load event handler:

Page.ClientScript.GetPostBackEventReference(this, String.Empty);

Thanks,

Eilon


that works. Thank you. btw ATLAS ROCKS!!

Appears to be an issue in the June CTP too... and if it wasn't for this post, I'd still have the issue.

Thanks guys


Correct, this was not fixed in the June CTP. For now the one line workaround should still be sufficient.

Thanks,

Eilon


In the case of nested UserControls, does this workaround apply? If so, where should the workaround go?

I have a page which contains a UserControl, which in turn contains another UserControl, which contains a GridView wrapped in an UpdatePanel. I tried adding this line to the page's Page_Load and the UserControl's Page_Load, but I get the same generic error:

Line: 10846
Char: 17
Error: Object required
FYI, the offending line appears to be the second one pasted below:

function destroyTree(element, markupContext) {

if (element.nodeType == 1) {


Any ideas?

slp004, can you please give more details as to what you're trying to do? It sounds like other people on this thread have this scenario working so I'm curious what's going on here.

Thanks,
Eilon


I was never able to figure out exactly what the problem was, but by breaking the page up into a number of smaller pages sharing a single master page it started working again. There were just way too many UserControls inside GridView inside FormView inside UserControls inside View areas inside show/hide panels... you get the idea.

I have exactly the same problem - in the same line

 function destroyTree(element, markupContext) {if (element.nodeType == 1) {

My page have three or four levels of nested user controls inside the update panel. The curious thing is the page with the same controls has worked before some change I did - now I am trying to figure it out.


Wow, I figured out the issue.

The error was caused because I have another updatepanel in this page - inside a user control, included in master page. The user control has Visible=false. This scenario causes the error. When I set the user control visibility to true, the error goes off.

The solution is setting the updatepanel (that is inside the user control) mode to Conditional. This solves the problem even if the user control is invisible.

HTH.


I had the same problem and I set all the update panels to conditional and it worked.

Paint Event

I'm new to asp.net ajax. and Im using vb.net class to develop the page. Can the drawing class be implemented here? Is the picture box in vb same as image in asp? I tried with event handler for image1.paint but it .paint gives error...

No, images in ASp are completely different. You can use GDI+ to draw, however, but it's a bit different from winforms development. Consider the tutorial athttp://www.samspublishing.com/articles/article.asp?p=25487&seqNum=3&rl=1 as a decent place to start.

paul