473,657 Members | 2,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2.0 Localisation problem Localizable attribute not working...

I have written a custom control called CheckboxDataLis t that derives
from the DataList webControl.

My control contains a public property called CheckedValues. The type of
this property is a generic <List> of strings
using System;
using System.Collecti ons.Generic;
using System.Componen tModel;
using System.Text;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Data;

namespace BFarm.WebContro ls
{
public class BfarmCheckboxDa taList : DataList
{
public List<string> CheckedValues
{
//
//
}
}

My control is defined as follows on my webform

<%@ Register Assembly="Contr olLibrary" Namespace="Cont rolLibrary"
TagPrefix="cc1" %>

<form id="form1" runat="server">
<cc1:CheckboxDa taList ID="BfarmCheckb oxDataList1"
runat="server" RepeatColumns=" 14"
RepeatDirection ="Horizontal " RepeatLayout="T able">
<ItemTemplate >
<asp:CheckBox ID="CheckBox1" runat='server' />
&nbsp;
<asp:Label ID="Label1" runat='server'
Visible="false" ></asp:Label>
</ItemTemplate>
</cc1:BCheckboxDa taList>
</form>

I am using the designed to generate the local resource files fro my web
form ( in design view navigate to Tools and click on Generate Local
Resources).

The IDE seems to think that the property of my control CheckedValues
should be localised and it adds the following code to my webform
CheckedValues=" (Collection)"
<cc1:BfarmCheck boxDataList ID="CheckboxDat aList1" runat="server"
RepeatColumns=" 14"
RepeatDirection ="Horizontal " CheckedValues=" (Collection)"
meta:resourceke y="BfarmCheckbo xDataList1Resou rce2" ReadOnly="False ">
<ItemTemplate >
<asp:CheckBox ID="CheckBox1" runat='server'
meta:resourceke y="CheckBox1Res ource2" />
&nbsp;
<asp:Label ID="Label1" runat='server' Visible="False"
meta:resourceke y="Label1Resour ce2"></asp:Label>
</ItemTemplate>
</cc1:CheckboxDat aList>

How can I prevent the ide from generating this code and how can I tell
the IDE not to treat this property as something that should be
localised?

I have tried decorating the property with the following attribute
[Localizable(fal se)]
But it does nothing

Help !!!

Feb 1 '06 #1
1 1498
Just decorate your property with following attributes:

[DefaultValue((s tring)null),
PersistenceMode (PersistenceMod e.InnerDefaultP roperty)]

Yes I know it's strange but it works.

Pawel Pabich

Feb 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3509
by: Simon Harvey | last post by:
Whato chaps, I work (or am hoping to work! :) for a company that specialises in the following: - Localisation of media - including software, manuals, literature and training material. - Creating training material themselves in many langauges built to order. The main thing I'm thinking about for the company is maybe a sort of content
0
994
by: Olivier Carpentier | last post by:
Hi i think that i have a bug with Visual Studio 2003 with localisation of forms in design mode. It's don't working only with one solution, when i'm trying with another solution, it's working fine On a form, i'm changing property localisable property to true, i'm changing of language and i change buttons text. But all changes affected all langages (default too) Someone know why Thanks by advance Olivier
3
1208
by: Robin Tucker | last post by:
I did a little experiment during localization of my software (or at least preparations for localization) - without adding any language resources, I just went through changing the Localizable property of each form from False to True. I noticed that the resulting Executable instead of being 4mb was closer to 8mb. This suprised me. So I did a little experiment. I set the localizable flag to false on one noddy form and then checked the...
3
8905
by: Michael Brown | last post by:
Hi there, After applying the "Localizable" attribute to my form using the (form) properties window in VS, I was expecting to see "" preceding my form's class in code (added automatically by the IDE). I don't however. Can someone point out where this info is stored. Thanks.
7
2262
by: Ryan | last post by:
I'm creating a user control that has a handful of controls on it (19 in total). One of the controls on the UC is a textbox for a user's password, so I've set the PasswordChar property to "*". I rebuild and all is well. The problem arises when I have the PasswordChar set, and then try to set Localizable to True for the UC. If I set Localizable to true and have PasswordChar set and rebuild, Visual Studio 2005 will then try to reload the...
2
3143
by: Peter Vestergaard | last post by:
Hi I have a project with quite a number of dialogs in it all with Localizable=true, and all except one working fine. But the one is causing me trouble because even though Localizable=true is set, all strings (.Text properties and the like) are still written to InitializeComponent() in the .cs file instead of to the .resx file. I have tried setting the Localizable to false again, saving/building/restarting studio, and then setting...
0
1092
by: Clive Dixon | last post by:
If I add a property of type string to a form which has attribute , the form editor stores the string list I enter in the associated .resx file as a base 64 string. Does anyone know of any resource editor which would enable me to store string resources in a general .resx file in the same way? -- ====================== Clive Dixon Digita Ltd. (www.digita.com)
6
1358
by: Nikola Skoric | last post by:
I wanted to add a comboBox with list of languages which makes labels and captions on my buttons to change when user changes the language. Is there a realy easy way to do it? Of course, I can just make an ArrayList of captions and labes for every language and then just choose an appropirate ArrayList depending on current language setting. But, I wonder if people who made VS already thought of that and built in some kind of support for...
0
1621
by: =?Utf-8?B?V2F5bmVN?= | last post by:
I just had a thought and wondered if I am missing something or it is a good suggestion. Looking at some code, I was sorting through strings that should be put into a resource file for localization and seeing which ones are not localizable. I'm used various tools to easily put the strings into a resource file, but it is still a manual process of evaluating whether a string should be localized or not.
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.