>For the null value where you tried to reference object ID this.grdvwUsers.ClientID, the code you posted looks ok. My first guess is that you have that object’s visible property set to false in the server side aspx page.
>
I've checked and the grid visible property is set to true. We only hide it when the user presses Edit button from this grid. So, it is supposed to be in the HTML and why the code doesn't work - it's a mystery.
>When you set the visible property false on a control such as a grid or button, the HTML for that component is NOT rendered to the clients browser. Since the HTML for the component is not sent to the browser your Javascript cannot reference it. If this is the case then you need to change the property of the control to true and hide it from the client by another means. You could wrap the control in a HTML DIV tag for example and have it hidden.
>
>I’m not sure I have the complete picture but when you use an edit button from a parent grid to display a control to edit the record, it typically requires the form to post to the server to get the selected data. It depends on how it’s implemented but if this is the case you could handle the displaying of the grid and edit control entirely on the server side.
How can I make the Cancel button to not perform a postback?
If it's not broken, fix it until it is.
My Blog