页面不能触发事件...

yd_910913 2011-12-07 01:53:47
我做了一个网页,

内容大概是一个新闻发布

文本框,下拉框,fck,两个按钮,GridView,分页控件AspNetPager

gridview 可以显示,但是不能点击,
AspNetPager 相同,
两个按钮也是一样,

鼠标浮上去左下角显示应该做的操作...


事情就是这个样子的....

问: 大概应该是哪里的问题...
...全文
128 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
心情灬麻醉师 2011-12-07
  • 打赏
  • 举报
回复
丢失事件??lz不应该那么倒霉吧?你看看你的页面最上变page标签有没有异常?
顺便问下,你那个页面是放在母版页里的还是单独的页面?
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
有的,

心情灬麻醉师 2011-12-07
  • 打赏
  • 举报
回复
from里有runat="server"吗??
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
不能触发onclick事件


也就是 页面上的按钮都不能用 包括GridView里面的按钮
心情灬麻醉师 2011-12-07
  • 打赏
  • 举报
回复
不触发command事件吧???
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
各位 救命啊!!!


来看看啊。。。。
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
怎么没人看了啊...
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
我检查了下,发现还是没什么问题....
kingflute1 2011-12-07
  • 打赏
  • 举报
回复
用了几个DIV?会不会是DIV遮盖了控件啊?
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
点击的时候 没有任何的反应,连后台都没有进入,
所有的js 都是引用过来的...没问题.
soft_lugy 2011-12-07
  • 打赏
  • 举报
回复
还有你前台有没有使用javascript呢
soft_lugy 2011-12-07
  • 打赏
  • 举报
回复
点击的时候有没有post到服务器端呢?
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
<asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="False"
Width="100%" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3" DataKeyNames="id"
onrowdatabound="myGridView_RowDataBound"
onrowdeleting="myGridView_RowDeleting"
onrowediting="myGridView_RowEditing"
onrowupdating="myGridView_RowUpdating"
onrowcancelingedit="myGridView_RowCancelingEdit"
onrowcommand="myGridView_RowCommand">
<FooterStyle BackColor="White" ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<Columns>
<asp:BoundField DataField="id" HeaderText="文章编号" ReadOnly="True">
</asp:BoundField>
<asp:BoundField HeaderText="文章类别" DataField="type" ReadOnly="True">
</asp:BoundField>
<asp:TemplateField HeaderText="编辑">
<ItemStyle />
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CommandArgument='<%# Eval("id") %>' CommandName="com"
onclick="LinkButton1_Click">编辑</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
</Columns>
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<webdiyer:AspNetPager ID="AspNetPager1" runat="server">
</webdiyer:AspNetPager>

<webdiyer:AspNetPager ID="AspNetPager1" runat="server">
</webdiyer:AspNetPager>


<asp:Button runat="server" ID="u23" CssClass="u23" Text="确定" onclick="u23_Click" />

<asp:Button runat="server" ID="u24" CssClass="u24" Text="重置" onclick="u24_Click" />


<asp:DropDownList runat="server" ID="dropList">
<asp:ListItem Value="新闻资讯">企业文化</asp:ListItem>
<asp:ListItem Value="SOD知识">公司荣誉</asp:ListItem>
<asp:ListItem Value="健康养生">领导关怀</asp:ListItem>
<asp:ListItem Value="健康养生">公司资质</asp:ListItem>
<asp:ListItem Value="健康养生">专家团队</asp:ListItem>
<asp:ListItem Value="健康养生">员工文化</asp:ListItem>
</asp:DropDownList>

<asp:TextBox runat="server" ID="txtTitle" Width="490px"></asp:TextBox>




BLL.About bll = new BLL.About();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetDateView();

}
}

protected void myGridView_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
myGridView.EditIndex = -1;
}

protected void myGridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "com")
{
string id = e.CommandArgument.ToString();
BLL.About Bll = new BLL.About();
DataSet ds = Bll.GetList("id=" + id);
if (ds != null && ds.Tables[0].Rows.Count != 0)
{
dropList.SelectedValue = ds.Tables[0].Rows[0]["type"].ToString();
FCKeditor1.Value = ds.Tables[0].Rows[0]["details"].ToString();
txtbox1.Text = ds.Tables[0].Rows[0]["id"].ToString();
}
}
}

protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{

}

protected void myGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = myGridView.DataKeys[e.RowIndex].Value.ToString();
BLL.About Bll = new BLL.About();
bool a= Bll.Delete();
if (a)
{
Response.Write("<script>alert('删除成功');</script>");
}
else
{
Response.Write("<script>alert('删除失败');</script>");
}
GetDateView();
}

protected void myGridView_RowEditing(object sender, GridViewEditEventArgs e)
{
myGridView.EditIndex = e.NewEditIndex;
}

protected void myGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

}

protected void u23_Click(object sender, EventArgs e)
{
if (txtbox1.Text == "" || txtbox1.Text == null)
{

Model.About model = new Model.About();
model.details = this.FCKeditor1.Value;
model.type = this.dropList.SelectedValue.ToString();
bool a = bll.Add(model);
if (a)
{
Response.Write("<script>alert('添加成功');</script>");
GetDateView();
}
else
{
Response.Write("<script>alert('添加失败');</script>");
GetDateView();
}
}
else
{
Model.About model = new Model.About();
model.id = Convert.ToInt32(this.txtbox1.Text);
model.details = this.FCKeditor1.Value;
model.type = this.dropList.SelectedValue.ToString();

if (bll.Update(model))
{
Response.Write("<script>alert('修改成功');</script>");
GetDateView();
}
else
{
Response.Write("<script>alert('修改失败');</script>");
GetDateView();
}

}
}

protected void u24_Click(object sender, EventArgs e)
{
this.FCKeditor1.Value = "";
this.txtbox1.Text = "";
}

protected void LinkButton1_Click(object sender, EventArgs e)
{
// myGridView.DataKeys[e.RowIndex].Value.ToString();
}
protected void GetDateView()
{
DataSet ds = new DataSet();
ds = bll.GetList(5, this.AspNetPager1.CurrentPageIndex, "", "id", "id,type,details");
AspNetPager1.RecordCount = int.Parse(ds.Tables[1].Rows[0][0].ToString());
this.myGridView.DataSource = ds;
this.myGridView.DataBind();
this.txtTitle.Text = "";
this.FCKeditor1.Value = "";
this.txtbox1.Text = "";
}
soft_lugy 2011-12-07
  • 打赏
  • 举报
回复
贴源码吧 你这样让大家意淫是看不出问题的
yd_910913 2011-12-07
  • 打赏
  • 举报
回复
就没有验证控件
liukaizxc 2011-12-07
  • 打赏
  • 举报
回复
验证控件 阻止了?

62,046

社区成员

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

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

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

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