我的解决方案中有多个包含default.aspx页面的子目录,所以当我使用url时:
http://www.mysite.com/products/
其中products是上面提到的一个子目录,它显示位于该目录中的default.aspx页面的内容。
每当页面上发生初始回发时,url都会更改为:
http://www.mysite.com/products/default.aspx
引发回发的事件已激发,但不会从该事件中生成任何结果,即(Gridview未绑定新结果)
如果我最初导航到该页面
http://www.mysite.com/products/default.aspx
然后,在第一次拍摄时,一切都会按预期发生。所以我假设它与我使用的URL有关,而不是具体的代码?
任何关于这个问题的反馈都将不胜感激。
这是从onclick事件中执行的,我在列表视图中有按钮,它命中最后一行,但不交换文本(url更改):
Protected Sub PrepareNewReason(ByVal sender As Object, ByVal e As EventArgs)
ListView1.EditIndex = -1
If CType(sender, Control).ID = "addReason1" Then
' We are on top of the list show entry row on top
ListView1.InsertItemPosition = InsertItemPosition.FirstItem
Else
ListView1.InsertItemPosition = InsertItemPosition.LastItem
End If
ListView1.FindControl("addReason1").Visible = False
ListView1.FindControl("addReason2").Visible = False
Label1.Text = "This Line was hit"
End Sub发布于 2009-07-07 17:52:24
不确定这是否会有帮助。可以是Web.Config中的设置。
发布于 2009-07-07 18:10:42
这可能与URL更改无关。尝试更简单的更改。在页面上放置一个标签,并更改触发PostBack的事件的标签文本。
https://stackoverflow.com/questions/1093524
复制相似问题