This is a migrated thread and some comments may be shown as answers.

Tricky localization issue in Editform

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Newbery
Top achievements
Rank 1
Steve Newbery asked on 19 Nov 2008, 03:00 PM
I'm using the FormTemplate example of the PopUp editform demo here, and I have to internationalize the text.

It's all ok, except for the declaration of the Update/Insert button which is:

<asp:Button ID="EditFormUpdateButton" runat="server" 
    Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>' 
    CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'   
    meta:resourcekey="EditFormUpdateButtonResource1">  
</asp:Button> 

The problem is: how to localize the "Insert" and "Update" text? I was thinking of using an explicit expression like so:

<%$ Resources:LabelResource1.Text %> 

But I don't see how to combine that with the "IIf (TypeOf ..." part.

Can anyone help plz?

Thanks, Steve

1 Answer, 1 is accepted

Sort by
0
Steve Newbery
Top achievements
Rank 1
answered on 21 Nov 2008, 09:08 AM
Aha - I found out how to do it, using the GetLocalResourceObject method, like so:

 
Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, GetLocalResourceObject("EditFormInsertButtonResource1.Text"), GetLocalResourceObject("EditFormUpdateButtonResource1.Text")) %>' 
 

Easy really! You could of course use GetGlobalResourceObject too.
Tags
Grid
Asked by
Steve Newbery
Top achievements
Rank 1
Answers by
Steve Newbery
Top achievements
Rank 1
Share this question
or