Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

explicite Resource

Hello,

I use explicite localization. Now I want combine the Resource string with a other string for the text attribute of a button control
like this:

<asp:Button ID="Button1" runat="server" Text="<%$ Resources:cari, EK %> test" />

but this doesn't work - havy anyone a solution?

Thank you
Reiner
0
seffer
Asked:
seffer
  • 2
1 Solution
 
Rajar AhmedConsultantCommented:
Try this,
    <asp:Button ID="Button1" runat="server" Text='<%# String.Format("{0}{1}",Resources.myResource.cari,"test")  %> ' ></asp:Button>

Open in new window


protected void Page_Load(object sender, EventArgs e)
    {
        Button1.DataBind();
    }

Open in new window

0
 
sefferAuthor Commented:
ok thank you, it works

But how can I do this with controls which I can not databinding?

Thank you
Reiner
0
 
Rajar AhmedConsultantCommented:
If your using expression binding on aspx you have to databind the corresponding control or you can call Page.DataBind(); globally.
Page.DataBind();

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now