ASP.Net localization and connection management

When I localize an asp.net page that uses bound controls (DetailsView, etc.) bind to TemplateFields using the syntax <% # Bind () #> after localization all bindings are removed and I have to go back and rewrite all. I create a localized resource file by switching to Design View, then under Tools / Generate Local Resource.

Has anyone else seen this issue, and if so, do you have any suggestions for a workaround?

Before:

<asp:TemplateField HeaderText="First Name:">
    <InsertItemTemplate>
        <uc:FirstNameTextBox runat="server" ID="FirstName" ValidationGroup="Main" Text='<%# Bind("FirstName") %>' />
    </InsertItemTemplate>
</asp:TemplateField>

      

After:

<asp:TemplateField HeaderText="First Name:" meta:resourcekey="TemplateFieldResource1">
    <InsertItemTemplate>
        <uc:FirstNameTextBox runat="server" ID="FirstName" ValidationGroup="Main" />
    </InsertItemTemplate>
</asp:TemplateField>

      


Edit: It looks like it's just my own UserControls that are losing binding. I tried adding Bindable and Localizable (false) attributes to properties, but that didn't seem to help.

+1


source to share


2 answers


Just found this ... http://blog.smart-ms.ordina.nl/Generate+Local+Resource+Files.aspx



It seems like the trick needs to be done without distorting your ASPX file at all ... I haven't run it on top of the main page / custom element yet.

+1


source


Yes! I have it happened to me, but also with user control. Is this a common problem? I don't know how to resolve this though.



Out of interest, is there an alternative to using Tools -> Generate Local Resource from the menu to generate resource files ??? Usually I already attach meta: resourcekey tags to my localizable content controls and don't want them to change it to anything else.

0


source







All Articles