how to run javascript and then do a postback?
<p>I am trying to create an add to 'favourites'button. When the user clicks this button the image has to be changed ( in js). After that I would like to do a postback the asp.net page? how can I make this work? sofar i got:</p>

<p>aspx</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function () {

            function ChangeFavStar() {
                if ($("#btnAddToFavs").attr('src') == 'starempty.jpg') {
                    $("#btnAddToFavs").attr('src') = 'staradded.jpg';
                }
                else {
                    $("#btnAddToFavs").attr('src') = 'starempty.jpg';
                }
                return true;
            }

        });

    &lt;/script&gt;
    &lt;style type="text/css"&gt;
        #btnAddToFavs {
            height: 79px;
            width: 121px;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
    &lt;asp:ImageButton ID=btnAddToFavs runat=server 
            OnClientClick="ChangeFavStar();" ImageUrl="~/starempty.jpg"
             Height="74px" Width="109px"  /&gt;

    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>cs behindcode</p>

<pre><code> protected void btnAddToFavs_Click(object sender, ImageClickEventArgs e)
        {
            //do stuff
        }
</code></pre>
