C# - ASP.NET - Best Practice For Reading Localized Strings From XML File?
Feb 14, 2011
I got an assignment to localize the website and to store all string values into the XML file. The reason for that is to let the sys. admin to change the localized values himself by editing XML file. Should I read the content of XML file and store in the memory on application startup? I guess there's a best practice for this kind of scenario.
View 2 Replies
Similar Messages:
Apr 4, 2011
I'm adding support for multiple language to my site. I've found many places in my renderers that have hard-coded strings I'll need to address.
I seem to have a couple different options of fixing this... one would be to use the standard .NET approach and store strings in a resource file. I'm not liking this because my Sitecore translators can't get to that... and also because I don't think Sitecore sets the Culture by default? Which I believe is how ASP.NET knows which language to use from the resource file.
Another option would be to add fields for all these strings in my Sitecore templates so they are visible to translators in Content Editor. But this seems like a huge hassle... there are many, many places where I would have to update my templates solely to store UI element strings.
View 1 Replies
Jul 28, 2010
How to use localized messages in javascript file in asp.net.
i have a javascript file(global-Scripts.js) which contains all my scripts.i use another file (messages.js) which has all the static error messages( ex: are you sure you want to delete ?) so that this can be localized.Is it possible localize this main script file without having another file(messages.js),so that i can remove one script reference ...
View 2 Replies
Sep 22, 2010
i would like to Load a Lcalized CSS and i have a Masterpage
i am trying to do something like...
1. Get the Client Locale (which i do on the global.asax onSession_Start event)
2. get the right CSS file for this local (since my website supports both RTL and LTR layout)
the CSS should be i.e. webpage.en-US.css (or similar) if the Client Local is en-US and if its he-IL it should be webpage.he-IL.css.
View 2 Replies
Mar 7, 2011
I know this is probably a pretty easy thing to do and it is if I can upload the file and store it onto the hard drive of the server. What I need to do is read the text file into memory and then parse through it one line at a time. Anyone have any code that demonstrates that?
View 8 Replies
Sep 20, 2010
I would like ask you for some ideas how can I write mechanism that will be automatically read files from folder. I don't know how to schedule the write task. I want to check for new file everyday and if the new file is in the folder read it.
View 2 Replies
Mar 10, 2011
I was trying to go through this tutorial:
[URL]
but when I tried to add the service reference to the silverlight app, the Add Service Reference window would show me that there was a service file, but the node wouldn't expand to show the rest of the files that contain the services and what not. I got this error instead:
"An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately."
"Parser Error Message:There is no service behavior named 'AdventureWorks_WebServer.Service1Behavior'."
"Metadata contains a reference that cannot be resolved: 'http://localhost:55579/Service1.svc'.
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
If the service is defined in the current solution, try building the solution and adding the service reference again."
here's my web.config file:
[Code]....
View 1 Replies
Mar 18, 2010
Is using an include file bad coding practice in asp.net? I am aware of master pages, etc. but it seems like in this case an old fashioned include file works best.I have a home page and I have an "all other" page. The all other page is my master page. I place the header include on the master page and at the top of the home page.
<!--#include file="inc/inc_header.aspx"-->
View 11 Replies
Jan 12, 2011
i like to create a web application,in that i need to get the resumes from the user,then i need to publish that resume to the manager in date wise..
View 5 Replies
Jan 21, 2011
In web service reading *.txt file .this file contains some special characters like "" .so its shows error while reading .
string fullPath = Server.MapPath("sample.txt");
string reconciliationData = string.Empty;
StreamReader ObjReconciliationDataStream = new StreamReader(fullPath, Encoding.UTF8);
string strReconData = ObjReconciliationDataStream.ReadToEnd();
ObjReconciliationDataStream.Close();
ObjReconciliationDataStream = null;
return strReconData;
above code i am using .
View 2 Replies
Jan 5, 2011
I would like to find a way to read a txt file (in my case delimited by €). I need to change the order of the columns and also add and remove some columns. My output file should be a txt file delmited by ;.
I tried Jet.OLEDB to read the file and put it into a datatable and then used a stringBuilder and streamwriter to get an output file in .txt format. However. This does not me since IŽ, reading the txt file from start to end and my output will be the same. It does not seem like I can have a custom sql statement when reading the file. The only query that works is
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from 1.txt", TextConn)
How can I possible modify a txt file?
This is my code for now:
[Code]....
View 1 Replies
Jan 4, 2011
As the title says then the question is relative simple however I cant decide whether a resource file with strings in is better than hard-coded strings...
View 3 Replies
Jan 12, 2010
Is that possible to add two connectionstrings in web.config and Can I call those two web.config in my aspx.cs file?
View 3 Replies
Jan 21, 2011
I would like to use both of the connection strings in the same web.config file how can I do this I tried this yesterday it worked I called it a night, then this morning I got this. The error being on line: 10 Parser Error Message: The entry 'ApplicationServices' has already been added.
Line 8: <add name="ApplicationServices"
Line 9: connectionString="Data Source=Mysource;Initial Catalog=travelatlantic;User ID=MyID; Password=MyPassword;" />
Line 10: <add name="ApplicationServices"
Line 11: connectionString="Data Source=MySource;Initial Catalog=travelatlantic2;User ID=Myid; Password=MyPassword;" />
Line 12: </connectionStrings>
View 8 Replies
Aug 3, 2010
I have developed an asp.net web application containing 40-50 pages. I have implemented logger using Log4net and each of my pages has this in its page_load event.
[code]...
This method has many strings like "In page Load function","OrgId","Homepage.aspx?Sid=1","Page load function successfull". Now i would like to maintain these string which are common throughout my application in a seperate class file and use it with a variable...
View 2 Replies
Mar 25, 2010
I need to read a rtf file and then display the same in div tag. and a normal html text box after reading the content i get to see rtf formating special characters Is there any way that i can remove these special formating characters?
View 3 Replies
Feb 10, 2011
I have a webform with 6 controls (3 drop downs, 2 text boxes, 1 file upload box). User makes selections, chooses a pdf file to upload, then clicks on a submit button which uploads the data and pdf file to a SQL database. Everything works good up to this point, data is uploaded, pdf is sent to database as binary data. Problem is that I can't seem to figure out how to get the form to "re-read" (for lack of a better word) the database, it looks as though a new record was not inserted although it was. There is a field for "ID" that shows what the record ID will be (the next greatest number to the previous record) and that field does not increment unless I stop running the web app and restart. I've included the code behind for the button_click event:
[Code]....
View 2 Replies
Nov 21, 2010
i want to read a file one by one form a directory and replace a string. hw can i do this?
View 2 Replies
Feb 3, 2010
I m reading the file. As I have very large files, it will take time to read.
In the mean time, I want to show progress bar.
View 2 Replies
Apr 8, 2010
In my application, i have one fileupload control which will take excel file. I want to read this excel file and want to store in datatable. How will i do this. I am using visual studio 2008.
View 8 Replies
Oct 31, 2010
THere is an external ASHX url that dinamically generates an XML file.
I tried to parse this XML using the doc.Load("http://www.domain.com.br/asp.net/integration.ashx") but it haven't worked.
The same code above work fine if I use a XML file instead of ashx one.
I need to read the XML file generated by the ASHX one in order to integrate the websites.
View 9 Replies
Mar 9, 2010
I m reading a text file. After reading all the lines, I want to insert those records into respective fields in database.
So how to store the 1 or 2 or 3 or 4 or 5 lines of records until I read the last record.?
[code]....
first 9 number is emp id, next is name and next is salary.
While I m reading, I can store only last record. How to store all the records in a array to store in the database after reading all the lines.
View 12 Replies
Nov 29, 2010
I have tab delimited .xls file. I want read this to a dataset. Oledb connection string is given below. But i'm getting one error on objConn.Open();
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties=Excel 8.0";
OleDbConnection objConn = new OleDbConnection(strConn);
objConn.Open();
Error : External table is not in the expected format.
How can i read tab delimited .xls file to a dataset using oledb connection?
View 5 Replies
Sep 21, 2010
I am looking for an accordion menu code sample to load it from the xml file rather than hardcoding the file names in the mark-up. if you are aware of any such menu controls? (something like the one at this link [URL]. it will be nice if I can pin it to the left as well)
View 1 Replies
Jan 13, 2010
I have a CSV file (with semicolon field separator) of 150MB (about 2 milion rows and 35 columns).
Now I want to loop through the CSV per row and get each row column.
View 5 Replies