Click here to Skip to main content
15,911,789 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: ASP.NET Routing Pin
Parwej Ahamad6-Oct-11 18:26
professionalParwej Ahamad6-Oct-11 18:26 
GeneralRe: ASP.NET Routing Pin
Dominick Marciano7-Oct-11 16:21
professionalDominick Marciano7-Oct-11 16:21 
QuestionAsp.net and uploading large files Pin
Ahmad Safwat4-Oct-11 14:30
Ahmad Safwat4-Oct-11 14:30 
AnswerRe: Asp.net and uploading large files Pin
uspatel4-Oct-11 21:31
professionaluspatel4-Oct-11 21:31 
GeneralRe: Asp.net and uploading large files Pin
Ahmad Safwat5-Oct-11 2:55
Ahmad Safwat5-Oct-11 2:55 
AnswerRe: Asp.net and uploading large files Pin
Ravindra Bisen5-Oct-11 6:41
Ravindra Bisen5-Oct-11 6:41 
GeneralRe: Asp.net and uploading large files Pin
Ahmad Safwat5-Oct-11 11:28
Ahmad Safwat5-Oct-11 11:28 
Questionload , change and save xml file as appropriate encoding Pin
oujeboland4-Oct-11 13:02
oujeboland4-Oct-11 13:02 
hi, i'm loading an aspx file by XmlTextReader class and trying to change the content and saving with appropriate encoding.
but after the changes the entered arabic characters are unreadable !

i added this before "" tag but it makes an exception and prevent resuming proccess:


<?xml version="1.0" encoding="utf-8" standalone="yes"?>

this is the codebehind:
[WebMethod]
public string addCommentAndChangePageSource(string commenter, string content,string pageAddress)
{
//Server.MapPath("~/" + pageAddress)
string Path = pageAddress.Replace("http://localhost:50814/jangalwiki/",Server.MapPath("~/"));
//System.IO.StreamReader r = new System.IO.StreamReader(pageAddress,System.Text.Encoding.UTF8);
XmlTextReader txReader = new XmlTextReader(pageAddress);

XmlDocument xmlDoc = new XmlDocument();
//xmlDoc.Load(r);
xmlDoc.Load(txReader);



int newCommentIndex = xmlDoc.GetElementsByTagName("commitedcomment").Count - 1;
XmlNode commitingNode = xmlDoc.GetElementsByTagName("commitedcomment")[newCommentIndex];
XmlNode freshNode = commitingNode.CloneNode(true);

XmlNode writerLabel = xmlDoc.GetElementsByTagName("commitedcommenterName")[newCommentIndex];
XmlNode commentContentLabel = xmlDoc.GetElementsByTagName("commitedcommentContent")[newCommentIndex];
XmlNode commentDate = xmlDoc.GetElementsByTagName("commitedcommentDate")[newCommentIndex];
XmlNode commentTime = xmlDoc.GetElementsByTagName("commitedcommentTime")[newCommentIndex];
Persia.SolarDate newDate = Persia.Calendar.ConvertToPersian(DateTime.Now);
string date = newDate.ToString();
string time = DateTime.Now.ToShortTimeString();

writerLabel.InnerText = commenter;
commentContentLabel.InnerText = content;
commentDate.InnerText = date;
commentTime.InnerText = time;

XmlNode commentsBox = xmlDoc.GetElementById("postComment");
commentsBox.AppendChild(freshNode);
//XmlDeclaration xmlDec = (XmlDeclaration)xmlDoc.FirstChild;
//xmlDec.Encoding = System.Text.Encoding.UTF8.ToString();
xmlDoc.Save(Path);

return "changed";
}
what to do?
Question"Microsoft JScript runtime error: Object expected" using Telerik MVC controls Pin
jboyd1114-Oct-11 5:54
jboyd1114-Oct-11 5:54 
QuestionSet the NavigateUrl of a ImageMap in Repeater Pin
Farhad Eft3-Oct-11 23:53
Farhad Eft3-Oct-11 23:53 
AnswerRe: Set the NavigateUrl of a ImageMap in Repeater Pin
Parwej Ahamad4-Oct-11 12:01
professionalParwej Ahamad4-Oct-11 12:01 
QuestionTCP/IP Client Server Chat Application in ASP.Net Pin
nitin_ion3-Oct-11 23:11
nitin_ion3-Oct-11 23:11 
AnswerRe: TCP/IP Client Server Chat Application in ASP.Net Pin
Parwej Ahamad4-Oct-11 12:06
professionalParwej Ahamad4-Oct-11 12:06 
QuestionAlternate for MasterPage Pin
Ramkumar_S3-Oct-11 22:20
Ramkumar_S3-Oct-11 22:20 
Questionsending email on particular Date & Time Pin
prasanna2043-Oct-11 21:47
prasanna2043-Oct-11 21:47 
AnswerRe: sending email on particular Date & Time Pin
Anurag Gandhi4-Oct-11 1:50
professionalAnurag Gandhi4-Oct-11 1:50 
AnswerRe: sending email on particular Date & Time Pin
Morgs Morgan4-Oct-11 5:06
Morgs Morgan4-Oct-11 5:06 
QuestionConnection String problem in web.config! Pin
5553363-Oct-11 20:09
5553363-Oct-11 20:09 
QuestionRedirect, url rewrite and login problem Pin
CodeGust3-Oct-11 16:04
CodeGust3-Oct-11 16:04 
AnswerRe: Redirect, url rewrite and login problem Pin
Morgs Morgan4-Oct-11 5:28
Morgs Morgan4-Oct-11 5:28 
GeneralRe: Redirect, url rewrite and login problem Pin
CodeGust4-Oct-11 5:52
CodeGust4-Oct-11 5:52 
GeneralRe: Redirect, url rewrite and login problem Pin
Morgs Morgan4-Oct-11 6:05
Morgs Morgan4-Oct-11 6:05 
QuestionImprove page performance for aspx page Pin
vishnukamath3-Oct-11 1:59
vishnukamath3-Oct-11 1:59 
AnswerRe: Improve page performance for aspx page Pin
Parwej Ahamad3-Oct-11 8:41
professionalParwej Ahamad3-Oct-11 8:41 
AnswerRe: Improve page performance for aspx page Pin
Not Active3-Oct-11 9:51
mentorNot Active3-Oct-11 9:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.