Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.dotnet.framework.aspnet.mobile
Datagrid control in ASP.Net mobile application
TJ
5/3/2005 1:40:00 PM
I want to use the datagrid control in an ASP.Net mobile web application
.
IS it possible to use it in mobile applications???
When I run the following code, I get a blank webpage.
I have added the datagrid inside the <Device Specific> tag
Any suggestions. Thanks
<% @Import Namespace="System.Data" %>
<% @Import Namespace="System.Data.SqlClient" %>
<HEAD>
<...
<meta
content="
http://schemas.microsoft.com/Mobile/Page"name="vs_targetSchema...
</HEAD>
<body Xmlns:mobile="
http://schemas.microsoft.com/Mobile/WebForm...
<script language="vb" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
If Not Page.IsPostBack then
BindData() 'Only bind the data on the first page load
End If
End Sub
Sub BindData()
Const SQL_CONNECTION_STRING As String =
"Server=WA;DataBase=SOLLI;user=sa;password=''"
Dim conConnection As New SqlConnection(SQL_CONNECTION_STRING)
Dim strSQL As String
strSQL = "xWEBRSM_SelectInvoices"
Dim cmdReport As New SqlCommand(strSQL, conConnection)
cmdReport.CommandType = CommandType.StoredProcedure
Dim prmSiteID As SqlParameter =
cmdReport.Parameters.Add("@SiteID", SqlDbType.Char, 10)
prmSiteID.Value = "S000766"
Dim myAdapter As New SqlDataAdapter(cmdReport)
Dim ds As New DataSet
myAdapter.Fill(ds)
conConnection.Close()
DataGrid1.DataSource=ds
Datagrid1.DataBind()
End Sub
</script>
<mobile:form id="Form1" runat="server">
<mobile:ObjectList id="ObjectList1" runat="server"
LabelStyle-StyleReference="title"
CommandStyle-StyleReference="subcommand"></mobile:ObjectList>
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice
Xmlns="
http://schemas.microsoft.com/mobile/html32template...
<HeaderTemplate>
<asp:DataGrid id="DataGrid1" runat="server">
</asp:DataGrid>
</HeaderTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:form>
</body>
1 Answer
Leon
6/24/2005 9:52:00 AM
0
use objectlist instead
"TJ" <flower_t@rediffmail.com> ????
news:1115127616.982287.97430@f14g2000cwb.googlegroups.com...
I want to use the datagrid control in an ASP.Net mobile web application
.
IS it possible to use it in mobile applications???
When I run the following code, I get a blank webpage.
I have added the datagrid inside the <Device Specific> tag
Any suggestions. Thanks
<% @Import Namespace="System.Data" %>
<% @Import Namespace="System.Data.SqlClient" %>
<HEAD>
<...
<meta
content="
http://schemas.microsoft.com/Mobile/Page"name="vs_targetSchema...
</HEAD>
<body Xmlns:mobile="
http://schemas.microsoft.com/Mobile/WebForm...
<script language="vb" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
If Not Page.IsPostBack then
BindData() 'Only bind the data on the first page load
End If
End Sub
Sub BindData()
Const SQL_CONNECTION_STRING As String =
"Server=WA;DataBase=SOLLI;user=sa;password=''"
Dim conConnection As New SqlConnection(SQL_CONNECTION_STRING)
Dim strSQL As String
strSQL = "xWEBRSM_SelectInvoices"
Dim cmdReport As New SqlCommand(strSQL, conConnection)
cmdReport.CommandType = CommandType.StoredProcedure
Dim prmSiteID As SqlParameter =
cmdReport.Parameters.Add("@SiteID", SqlDbType.Char, 10)
prmSiteID.Value = "S000766"
Dim myAdapter As New SqlDataAdapter(cmdReport)
Dim ds As New DataSet
myAdapter.Fill(ds)
conConnection.Close()
DataGrid1.DataSource=ds
Datagrid1.DataBind()
End Sub
</script>
<mobile:form id="Form1" runat="server">
<mobile:ObjectList id="ObjectList1" runat="server"
LabelStyle-StyleReference="title"
CommandStyle-StyleReference="subcommand"></mobile:ObjectList>
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice
Xmlns="
http://schemas.microsoft.com/mobile/html32template...
<HeaderTemplate>
<asp:DataGrid id="DataGrid1" runat="server">
</asp:DataGrid>
</HeaderTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:form>
</body>
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Datagrid control in ASP.Net mobile application
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