开发者

label text not persisting on a published website

开发者 https://www.devze.com 2023-02-24 11:25 出处:网络
I have a label on my master page with a default text <dxe:ASPxLabel ID=\"m_Label\" runat=\"server\" Font-Bold=\"True\"

I have a label on my master page with a default text

<dxe:ASPxLabel ID="m_Label" runat="server" Font-Bold="True" 
    ForeColor="White" RightToLeft="True" Text="LabelText">
                    </dxe:ASPxLabel>

And then I set the text on the Master page

if (!Page.IsPostBack && !Page.IsCallback)
{
 if(condition)
 {
   m_Label.Text="one"
 }
 else
 {
  m_Label.Text="two"
 }

}

If I run my web page from the source code it displays the correct text i开发者_开发百科.e one or two. But if I publish my web page and then open the page it always says "LabelText"

Am I missing anything?


Just a thought, but is the page being cached? I noticed the code is set to run when NOT a postback (i.e. this is a GET request) and as such, could be subject to caching. Try CTRL+F5 in Internet Explorer to force a refresh. Alternatively, are you using a proxy server? That may also be caching the page.

0

精彩评论

暂无评论...
验证码 换一张
取 消