Get RSS URL from SPList object

RSS feeds are generated with the help of listfeed.aspx which resides in the layouts folder. It take list id as parameter through querystring. Will be posting other overloaded methods for variants.
public string GetRSSUrl(SPList list)
{
     string rssurl = string.Empty;
     using (SPWeb web = new SPSite(list.ParentWeb.Url).OpenWeb())
     {
          rssurl = web.Url + "/_layouts/listfeed.aspx?list=" + list.ID;                
     }
      return rssurl;
 }

Comments

  1. Anonymous4:00 AM

    Hi Rajesh,

    I've seen your post on creating stickies in SharePoint team discussions, and have followed it - but I have a quick question. I was wondering if you could email me on eastington@leicestercollege.ac.uk, then I'll reply with my question.

    Many thanks

    Beth

    ReplyDelete
  2. Hi Beth, you write me at Rjesh@Rjesh.com

    ReplyDelete
  3. Anonymous11:08 AM

    string fileName = @"url.docx";
    SPFile spFile =
    SPContext.Current.Web.GetFile(fileName);

    Response.ClearHeaders();
    Response.ClearContent();

    Response.ContentType = "application/force-download";
    Response.AppendHeader("content-disposition", "attachment; filename=e.docx");
    Response.BinaryWrite(spFile.OpenBinary());
    StringBuilder str = new StringBuilder();
    str.Append("");
    Response.BinaryWrite(str.);
    Response.End();

    i'm having issues with the above code. can you help please

    ReplyDelete
  4. Anonymous9:04 AM

    //Display users from people/Group field to People Picker Control

    if (itmAudit["Staff Assigned"] != null)
    {
    char[] to_splitter = { ';' };
    string to_list = itmAudit["Staff Assigned"].ToString(); // Reads value stored in SPList. (i.e., "Domain\User1; Domain\User2")
    string[] arr = to_list.Split(to_splitter);
    string user = string.Empty;
    System.Collections.ArrayList entityArrayList = new System.Collections.ArrayList();
    for (int i = 1; i < arr.Length; i++)
    {
    if ((i % 2) != 0)
    {
    user = arr[i].Substring(arr[i].IndexOf("#") + 1);
    PickerEntity entity = new PickerEntity();
    entity.Key = user;
    entity = userPicker.ValidateEntity(entity);
    entityArrayList.Add(entity);
    }
    }

    userPicker.UpdateEntities(entityArrayList);

    //Save users to people/Group field from People Picker Control

    SPFieldUserValueCollection values = new SPFieldUserValueCollection();
    foreach (PickerEntity entity in userPicker.ResolvedEntities)
    {
    SPFieldUserValue fuv = new SPFieldUserValue(SPContext.Current.Web, Convert.ToInt16(entity.EntityData[PeopleEditorEntityDataKeys.UserId]), entity.Description);

    values.Add(fuv);
    }

    itmAudit["Staff Assigned"] = values;

    ReplyDelete

Post a Comment