Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.dotnet.framework.aspnet.mobile
ASP.NET Mobile - a code error of POSTBACK Asp.Net Mobile/ObjectLis
LADEF - BRAZIL
7/12/2008 2:27:00 PM
Hello personal gear as I would like to correct this error in ASP.NET MOBILE
Application Server Error in '/ VS2005/NET2.0/AspNetMobile/objectlistbind'.
--------------------------------------------------
------------------------------
Invalid posted date for current ObjectList ViewMode. (The ObjectList may
have been databound on postback during Page_Load, resetting the ViewMode.
Call DataBind in Page_Load only if IsPostBack is false.)
Description: There was an exception untreated during the implementation of
the current web request Examine the tracking of battery for more information
about the error and which originated in the code.
Details of the Exception: System.Exception: Invalid posted date for current
ObjectList ViewMode. (The ObjectList may have been databound on postback
during Page_Load, resetting the ViewMode. Call DataBind in Page_Load only if
IsPostBack is false.)
The error happens qdo click on the link command text - Return to list
Below the source and the code-behind the application
source
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<html xmlns="
http://www.w3.org/1999/x...
>
<body>
<mobile:Form id="Form1" runat="server">
<mobile:ObjectList ID="ObjectList1" Runat="server" BackCommandText="Return
to List"
CommandStyle-StyleReference="subcommand" LabelStyle-StyleReference="title">
</mobile:ObjectList>
</mobile:Form>
</body>
</html>
code-behind
Imports System.Data
Imports System.Data.OleDb
Partial Class _Default
Inherits System.Web.UI.MobileControls.MobilePage
Protected Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Form1.Load
Dim DBConn As OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DSPageData As New DataSet
DBConn = New OleDbConnection( _
"PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
& "DATA SOURCE=" _
& Server.MapPath("EmployeeDatabase.mdb;"))
DBCommand = New OleDbDataAdapter _
("Select * " _
& "From Employee " _
& "Order By FirstName", DBConn)
DBCommand.Fill(DSPageData, _
"Emps")
ObjectList1.DataSource = _
DSPageData.Tables("Emps").DefaultView
ObjectList1.DataBind()
End Sub
End Class
pd if someone help me now thank you
Translated from Portuguese into English by Google
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
ASP.NET Mobile - a code error of POSTBACK Asp.Net Mobile/ObjectLis
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password