我向一个按钮添加了代码,但在单击它时会出现"Object expected“Javascript错误
Me.btnReport.Attributes.Add("onclick", String.Concat(New String() {"Javascript:ShowDocument('frmDocReport.aspx?PrjId=", Me.droplstProject.SelectedItem.Value, "&Type=", Me.droplstType.SelectedItem.Value, "&RecPerPage=", Me.droplstPAGE.SelectedItem.Value, "&DocNo=", Me.txtSearch.Text, "')"}))
我认为这很简单,但我不能解决
在我的视图源代码中,我可以看到如下所示
onclick="Javascript:ShowDocument('frmDocReport.aspx?PrjId=48&Type=0&RecPerPage=5&DocNo=');"发布于 2010-07-19 20:10:10
您正在使用的某个JS对象为空或不存在。不可能从代码片段中分辨出是哪一个。使用javascript调试器,如FireBug,检查这些值并确定哪些值为空。然后,您应该能够返回到该值为空的原因,并解决错误。
https://stackoverflow.com/questions/3280865
复制相似问题