Changing my control state after binding repeater with other ObjectDataSourceID
<p>I have this weird problem on my blog site(WIP) which I haven't found a solution for.  I have a repeater who gets all the articles from a SQL database with a <code>ObjectDataSourceID</code> called <code>dsGetArticles</code>.</p>

<p>What I want to do is when someone clicks a article, I change the <code>ObjectDataSourceID</code> to <code>dsGetArticle</code>. So far so good,everything works, i see 1 article instead of all the articles.</p>

<p>Now after I checked if the user is logged in , I wanna add/remove editing functionality so if the user is not logged in, obviously he is not allowed to change the article nor the comments from it.</p>

<p>So when the page loads and the user isn't logged in, I set the panel with edit functions invisible.That works,but as soon as he clicks the article (not a postback) the edit functions become visible again even though it went through the code behind and made the panel invisible.</p>

<p>The problem only occurs when I change the <code>ObjectDataSourceID</code> and databind it.</p>

<p>This is my codebehind for this:
(standard the Panel is visible)</p>

<pre><code>if (!IsPostBack)
        {
            if (Request.QueryString["articleID"] != null)
            {
                repArticles.DataSourceID = "dsGetArticle";
            }
            else
            {
                repArticles.DataSourceID = "dsGetArticles";
            }
            repArticles.DataBind();
        }
        if (!User.Identity.IsAuthenticated)
        {
            foreach (RepeaterItem ri in repArticles.Items)
            {
                Panel pnlArticleFunctions = ri.FindControl("pnlArticleFunctions") as Panel;
                pnlArticleFunctions.Visible = false;
            }
        }
</code></pre>

<p>I have tried using a <code>Linkbutton</code> as well so I could do it with a postback but I got the same result, no Panels are invisible :</p>

<pre><code>protected void lbLink_Click(object sender, EventArgs e)
    {
        repArticles.DataSourceID = "dsGetArticle";
        repArticles.DataBind();
        foreach (RepeaterItem ri in repArticles.Items)
        {
            Panel pnlTest = ri.FindControl("pnlTest") as Panel;
            pnlTest.Visible = false;
        }
         //doesnt become invisible
    }
</code></pre>
