jQuery works, then it doesn't anymore
<p>I have a function in my main to load a dialog box:</p>

<pre><code>&lt;a href="#" class="insert" onclick="return openDialog('AddEditUser.aspx',350);"&gt;Add new&lt;/a&gt;
</code></pre>

<p>This works because all the jquery script are loaded at the start of the main and I have defined the openDialog function.</p>

<p>But inside 'AddEditUser.aspx', the page that is opened, there is this code to close the dialog box at the end:</p>

<pre><code>string script = @"jquery('#dialog').html('');jquery('#dialog').dialog('destroy');window.location.reload()";
ScriptManager.RegisterClientScriptBlock(this, typeof(UpdatePanel), "jscript", script, true);
</code></pre>

<p>And when I run the program, I always get the error "Runtime-error Microsoft JScript: Object expected" at this last jquery code sequence.</p>

<p>I googled the error and it says you get this because jquery isn't loaded but it is because the dialog box opened. What is the cause of this error?</p>
