有错吗为什么不显示了

8080 2003-01-30 10:14:54
<ASP:DataGrid id="DataGrid1" runat="server" AllowPaging="True" PageSize="5"/>

改成能分页的东东为什么反到不显示这个控件了?
...全文
146 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
AFEN2009 2003-05-04
  • 打赏
  • 举报
回复
DataReader对象绑定Datagrid 不能进行分页操作!!!
还用是DataSet对象的DefaultView来与DataGrid对象绑定
lilyfirstone 2003-02-22
  • 打赏
  • 举报
回复
分页不显示多半是因为没有数据绑定的原因
huan_jinwu(金屋藏娇,得抱源码归) 是对的,不需要"完整的代码"
如果你没有自己的绑定函数,就把Binding();改成this.DataGrid1.DateBind();就行了
csharplove 2003-02-22
  • 打赏
  • 举报
回复
DLL文件损坏,建议改成代码前置,将ASPX页面导入代码一行删掉,我也有一样的问题,代码前置无问题
8080 2003-02-04
  • 打赏
  • 举报
回复
谢谢啊

这位兄台可否给我一份完整的代码呢

我再送分啊
huan_jinwu 2003-02-03
  • 打赏
  • 举报
回复
try
<ASP:DataGrid id="DataGrid1" runat="server" AllowPaging="True" PageSize="5"/>
改成
<ASP:DataGrid id="DataGrid1" runat="server" AllowPaging="True" PageSize="5" OnPageIndexChanged="DataGrid1_Updt"></asp:DataGrid>
or
<ASP:DataGrid id="DataGrid1" runat="server" AllowPaging="True" PageSize="5" OnPageIndexChanged="DataGrid1_Updt" />
还要加入分页代码:
public void DataGrid1_Updt(object sender,DataGridPageChangedEventArgs e)
{
this.DataGrid1.CurrentPageIndex = e.NewPageIndex ;
Binding();//自己绑定表格数据
}
8080 2003-02-03
  • 打赏
  • 举报
回复
有无人帮我啊
8080 2003-01-30
  • 打赏
  • 举报
回复
哥们你试一下就知道了自己缠个库吧

<% @ Page Language="VB" %>
<% @ Import Namespace="System.Data" %>
<% @ Import Namespace="System.Data.OleDb" %>
<html>
<head>
<title>第二十三例 数据库的简单查询实例</title>
<link rel="stylesheet" href="webclass.css" type="text/css">
<Script Language="VB" Runat="Server">

Dim public myConnstring as string = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &

Server.MapPath("dbook.mdb")
Dim MyConnection as OleDbConnection
'定义连接的字符串为公共变量,利于多次访问

public Sub Page_Load(sender As Object,e As EventArgs)
Dim selstr as string ="Select * from dbook Order by ID"
try
MyConnection = new OleDbConnection(myConnstring)
'设定联结
Dim MyCommand as OleDbCommand = new OleDbCommand(selstr,MyConnection)
MyConnection.Open()
'打开连接
dim shtI as Short
Dim MyDataReader as OleDbDataReader = MyCommand.ExecuteReader()
DataGrid1.DataSource=myDataReader
DataGrid1.DataBind()
'数据的读取
Do While MyDataReader.Read()
For shtI=0 To MyDataReader.FieldCount-1
Response.Write(MyDataReader.GetValue(shtI) & " / ")
Next
Response.Write("<br>")
Loop
MyDataReader.Close()
MyConnection.Close()
catch ee As Exception


finally
End try
End Sub
</script>

<ASP:DataGrid id="DataGrid1" runat="server" AllowPaging="True" PageSize="5"/>

<body>
<center>
<table border=0 cellpadding=3 cellspacing=1 height=8 width="560" class="tx105pt"

bgcolor="#7D007D">
<center>
</center>
<tr>
<center>
<td height=19 width=168><font color="#ffffff"> <b>作者信息</b></font></td>
</center>
<td height=19 width=436>
<p align="left"><font color="#ffff00"> <font

color="#FFFFFF"><b>留言内容:</b></font></font></p>
</td>
</tr>
</table>
<table width="560" border="0" cellspacing="0" cellpadding="0" bgcolor="#7D007D">
<tr>
<td>
<table border=0 cellpadding=3 cellspacing=1 height=8 width="560" class="tx9pt">
<tbody>
<tr>
<td bgcolor=#FDF9FD height=8 rowspan=3 valign=top width=150> <br>
<table width="150" border="0" class="tx9pt" cellspacing="0" cellpadding="1">
<tr>
<td width="40"><font color="#660066">头像:</font></td>
<td width="110"><img src="pic/Image57.gif"></td>
</tr>
</table>
<table width="150" border="0" class="tx9pt" cellspacing="0" cellpadding="1">
<tr>
<td width="40"><font color="#660066">大名:</font></td>
<td width="110">阿莱 [先生]</td>
</tr>
</table>

<table width="150" border="0" class="tx9pt" cellspacing="0" cellpadding="1">
<tr>
<td width="40"><font color="#660066">OICQ:</font></td>
<td width="110"></td>
</tr>
</table>
<table width="150" border="0" class="tx9pt" cellspacing="0" cellpadding="1">
<tr>
<td width="40"><font color="#660066">邮件:</font></td>
<td width="110"><img border=0 src="images/mail.gif" width="15"

height="15"> <a href="mailto:mwml-llww@21cn.com">邮件</a></td>
</tr>
</table>
<table width="150" border="0" class="tx9pt" cellspacing="0" cellpadding="1">
<tr>
<td width="40"><font color="#660066">主页:</font></td>
<td width="110"><img border=0 src="images/home.gif" width="15"

height="15"> <a href="http://9820.9126.com" target="_blank">主页</a></td>
</tr>
</table>
<table width="150" border="0" class="tx9pt" cellspacing="0" cellpadding="1">
<tr>
<td width="40"><font color="#660066">IP:</font></td>
<td width="110">218.104.226.234</td>
</tr>
</table>
</td>
<td bgcolor=#f7f7f7 height=1 width=410><img src="images/text.gif" width="18"

height="18">
主题:羊年快乐!!!
<tr>
<td bgcolor=#ffffff height=90 width=410>
<table border=0 cellpadding=3 cellspacing=0 height="100%" width="100%"

class="tx9pt">
<tbody>
<tr>
<td valign=top width="100%" height="94">是这样的:<br><br>可能是我小时候老爱吃

甜食,搞得我现在牙坏得差不多了啊..<br><br>有一两个较严重,其它都蛀牙了~可我今年20岁呀..<br><br>这

几天有一颗坏了一半痛要命,我想补牙,在原有的基础修复并套上一颗新牙,<br><br>请问。要怎么收费呀,

。。。。<br><br>请与我mail:mwml-llww@21cn.com  好吗?<br><br><br>羊年happey~ </td>
</tr>
<tr>
<td valign=top width="100%"><font color="#cc0000">

</font>
</td>
</tr>
<tr>
<td valign=top width="100%">
<div align="right">[发表于:2003-1-26 21:39:22 ]</div>
</td>
</tr>
</tbody>
</table>
<tr>
<td bgcolor=#f7f7f7 height=10 width=410>  <img border=0 src="images/mail.gif"

width="15" height="15"> <a href="mailto:mwml-llww@21cn.com">邮件</a>
<img border=0 src="images/home.gif" width="16" height="16"> <a

href="http://9820.9126.com" target="_blank">主页</a>
<img alt='阿莱的IP:218.104.226.234' border=0 src="images/ip.gif" width="13"

height="15"> IP

</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</center>
</body>
</head>
</html>
117hn 2003-01-30
  • 打赏
  • 举报
回复
你再说的详细些

62,039

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧