I have created a ProductResources.resx file. The name and value fields contain the ® character. THis is the R with a circle around it. It is a reg trademark. Obviously this needs to be there. An the resource file itself gives a red circle with a question mark inside it. Please help.
Depending on the encoding you declare for the resx XML, you can probably use one of the following:
® (iso-8859-1 or utf-8)
™ (unicode)
here's what you must do:
add a app_local_resources folder(right click on your project --> add asp.net folder)
name the resource folder as the following: PageName.aspx.resx
add the button name and property ( eg. Button1.Text) in the resource file name field
copy (by just highlight the registered trade mark from any source and copy it, paste in the value field from here
go to your button and add the following such as:
asp:Button ID="Button1" runat="server" Text="" onclick="Button1_Click" meta:resourcekey="Button1"
alt text http://img7.imageshack.us/img7/2108/59469768.jpg
hope this is what you want :)
Related
I'm trying to change the testimonials on our site. (Our web developer is out of the picture.) This is what I find in the code for where the testimonials are.
<asp:Repeater runat="server" ID="testimonials">
<ItemTemplate>
<p class="testimonial">"<%# DataBinder.Eval(Container.DataItem, "Text") %>"</p>
</ItemTemplate>
</asp:Repeater>
My research so far has told me there should be a table(?)(dataitem?) somewhere called "Text" with the testimonials listed. It is my understanding that the "asp:Repeater" function repeats a specified format for every item in the list/table. That is all fine. I only need to change the text of the testimonials, which I believe are in this "Text" table or list.
I don't know how to search for this within the website directory. I've downloaded FileZilla, Kompozer, SeaMonkey and Firebug. If any of those programs can help, I will use them, but any way will do.
Basically, I'm looking for a way to search the variety of files and folders within the directory for the table/lists of testimonials. I gave the details at the beginning in case I'm missing something or misguided about the concept.
DataItem is the data source bound to it. Text is a property within the row of the data source. Look for a Repeater.DataSource = X line, or a DataSourceID="X" on the repeater's markup. That will identify the data source.
i have an asp.net webpage, which contains a label, now i want to get the text property of the label from the localresource file, i have a .resx file under App_LocalResources folder, which contains Name as UserNameLabel.Text and Value as User Name now in my aspx file i am using Label control like this
<asp:Label ID="UserNameLabel" runat="server" resourcekey="UserNameLabel"></asp:Label>
but i cannot get the text on the Label, can anyone tell me the correct way to add the Text Property from resource file
First you need to create appropriate structure inside web project. In this case I will be using Default.aspx:
Take notice I have placed Default.aspx.resx file inside App_LocalResources.
Next enter new item inside Default.aspx.resx like this:
The important thing is you need to set Text property (UserNameLabel.Text)
And finally here is aspx code:
<asp:Label ID="UserNameLabel" runat="server" meta:resourcekey="UserNameLabel"></asp:Label>
I have used meta:resourcekey to link to appropriate resource key.
I can't seem to find a detailed example of how a local resource file looks like and its content
I have been reading up on this link
http://msdn.microsoft.com/en-us/library/ms227427.aspx
I want to use implicit localization with local resources.
So if I have a page: Products.aspx and want to create a default resource file then I need to create Products.aspx.resx and placed in App_LocalResources folder?
What does it contain say for example I want to change the values for a button control with ID="btnSubmit" ?
Is it like:
btnSubmit.Text = "Click here" ?
Yes you would place the "Products.aspx.resx" in the App_LocalResources.
You would then create an item in the resource file where:
Name = btnSubmit.text
Value = Click Here
your aspx page would have the button with the resource key defined:
<asp:Button runat="server" ID="btnSubmit" meta:resourcekey="btnSubmit" />
I have a global resource file: ContactDetails.resx. In here are addresses and contact information used around the website.
I also have a contact page listing all the contact details, but changing depending on language. So on the UK website, the UK contact details appear at the top, whereas on the French website the French details will appear at the top.
Is there a way to nest resources, referencing a resource value from within the value of a different resource?
If a resource value doesn't exist in your French resource file, but does in your Default resource file, the system will automatically get the value from the default resource file.
So if your localization is set to fr, and your call is something like:
Resources.ContactDetails.Telephone
And Telephone doesn't exist in ContactDetails.fr.resx then it will get the Telephone value from ContactDetails.resx
If all the values are to be displayed on the page, but in a different order depending on the localization I would recommend not storing these in a resource file. The resource file variations are for changes in language, not to change layout of data.
Instead I would recommend to store these in the database, and have 3 literal controls on the page like:
<asp:literal id="ltl1stTelephone" runat="server" />
<asp:literal id="ltl2ndTelephone" runat="server" />
<asp:literal id="ltl3rdTelephone" runat="server" />
Then depending on the localization, specify which values should be assigned to each control.
if (System.Threading.Thread.CurrentThread.CurrentUICulture = "fr"){
.........
}
Is it possible to display a special character like trademark on an ASP button control? if so, how do I do that
You can use html codes such as © = © and ™ = ™ etc in the text property of your button.
For a more detailed list of these codes: http://www.ascii.cl/htmlcodes.htm
example:
<asp:Button ID="tradeMarkButton" runat="server" Text="TradeMark™" />
Use character map (press start, run and type charmap then enter) select the special character, copy to the clipboard and paste into the text property of the control.