good day all.
I have a question and if someone now i be grateful.
I have a txt file and i wright in some data from multiline textbox
and the data are wright in, in multiple line.
this data I display in literal control but the data are display in one line.
FileStream fs = new FileStream(Server.MapPath("baza.txt"), FileMode.Open);
StreamReader sr = new StreamReader(fs);
string txt = sr.ReadToEnd();
sr.Close();
fs.Close();
Literal1.Text = txt;
txh aleksandar!
Loading
VulpesRank #55 · 29.2K reputationPosted Jan 11, 2012, 12:49 AM EST
tags so that it will render correctly.
VulpesRank #55 · 29.2K reputationPosted Jan 8, 2012, 2:42 AM EST
Literal1.Text = txt.Replace("\r\n", "
");
aleksandar ruba33 reputationPosted Jan 8, 2012, 3:02 AM EST
I have one link button under this literal and this is not display anymore,
if I put this link button upper literal then is work fine.
can you explane to me and thank you .
VulpesRank #55 · 29.2K reputationPosted Jan 8, 2012, 3:28 AM EST
aleksandar ruba33 reputationPosted Jan 8, 2012, 4:02 AM EST
and
I think do in this way,what you mean?and how to put data in literal?
List list = new List(); using (StreamReader reader = new StreamReader("file.txt")) { string line; while ((line = reader.ReadLine()) != null) { list.Add(line); // Add to list. Console.WriteLine(line); // Write to console.VulpesRank #55 · 29.2K reputationPosted Jan 8, 2012, 6:04 AM EST
So there must be some other reason why the LinkButton is getting overwritten by the text though, sorry, I can't think of anything else at present.
When I tried it myself, it just moved down the page - no matter how much text I put in the Literal - as you'd expect it to do.
Suthish NairRank #92 · 22.8K reputationPosted Jan 9, 2012, 1:19 AM EST
aleksandar ruba33 reputationPosted Jan 10, 2012, 11:43 PM EST
I wont to do litlle cms for practice,
in one page put some text from multi line textbox in txt.file and in another page display this text from txt.file in literal or label
The value is irrelevant,must be a text.
If you have another sugestion for do this I be grateful because I am a beginner in asp and sorry for my english.
aleksandar ruba33 reputationPosted Jan 11, 2012, 1:06 AM EST
under this, link button displayed fine,this solution is fine for me because the paragraf may be fixed in design of page.
thank you very much for you engagment and your speed of answers.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts