none
Add DESCRIPTION to .ics file RRS feed

  • Question

  • i have to add  the DESCRIPTION in (VEVENT) .ics file.

    The content of the description has to be passed from C# page in this form.

    String ActivityInfo=lblDescription.Text+ '\n' + lblContract.Text+ '\n' + lblCreatedBy.Text;

    Adding ActivityInfo to ics file=>

    writer.WriteLine("DESCIRPTION:" +ActivityInfo);

    when i import the ics file in MS Outlook,the Descrption field is blank.

    StreamWriter writer = null;
            string filePath = string.Empty;
            string path = HttpContext.Current.Server.MapPath(@"~/iCal_icsFiles/");
            filePath = path + subject + ".ics";
            writer = new StreamWriter(filePath);
            writer.WriteLine("BEGIN:VCALENDAR");
            writer.WriteLine("VERSION:2.0");
            writer.WriteLine("PRODID:-//hacksw/handcal//NONSGML v1.0//EN");
            writer.WriteLine("BEGIN:VEVENT");
    
            string startDateTime = GetFormattedDate(stdate) + "T" + GetFormattedTime(startTime);
            string endDateTime = GetFormattedDate(endate) + "T" + GetFormattedTime(endTime);
    
            writer.WriteLine("DTSTART:" + startDateTime);
            writer.WriteLine("DTEND:" + endDateTime);
            writer.WriteLine("SUMMARY:" + subject);
            writer.WriteLine("DESCRIPTION:" + ActivityInfo);
            writer.WriteLine("LOCATION:" + location);
            writer.WriteLine("END:VEVENT");
            writer.WriteLine("END:VCALENDAR");
            writer.Close();
    Pls tell how the data from cs page could be passed to ics file in formatted way or how to insert new line in .ics file.



    Friday, October 18, 2013 11:45 AM

Answers