0

I have a little situations. I have one button who needs to change when one flag from my database have some value. I can make it simple, but I need to make it from Resources because when the user change language, the text needs to change on proper language.

.ascx code:

<div class="" style="text-align: right; margin-top: 5px; padding-top: 5px; text-align: right;">
    <asp:Button ID="btnSave" runat="server" Text="<%$ Resources:Resource, Save %>" OnClick="OnSaveClick" CssClass="btn btn-primary" />
</div>

.cs code :

 Customer c = new Customer().GetById(Convert.ToInt32(curentId));

        if (c.Image == null)
            imgProd.ImageUrl = "/styles/img/defaultProduct.jpg";
        else
        {
            string strBase64 = Convert.ToBase64String(c.Image);
            imgProd.ImageUrl = "data:Image/jpg;base64, " + strBase64;
        }
        if (c.Lead == 1)
        {
            btnSave.Text = "Save as Partner";
        }

I want to make something like this:

btnSave.Text = Resources:Resource, SaveasPartner;

I hope I made myself clear abouth what I am trying to do.

Thanks

1

1 Answer 1

0

I have tried this and it works for me:

 if (c.Lead)
            {
                btnSave.Text = Resources.Resource.saveaspartner;
            }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.