views:

15

answers:

1

I added code to one button but while clicking it raises "Object expected" Javascript error

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, "')"}))

I think its simple but I am not able to solve

In my view source I can see like this

onclick="Javascript:ShowDocument('frmDocReport.aspx?PrjId=48&Type=0&RecPerPage=5&DocNo=');"
A: 

One of the JS objects you are using is null or does not exist. It is not possible to tell from the code snippet which one. Use a javascript debugger such as FireBug to inspect the values and work out what is null. From that you should then be able to work back to why that value is null and solve the error.

Ben Robinson