תשובה REdriect to List settings page

  • יום שלישי 01 מאי 2012 15:07
     
     

    Hi

    I have SPList object , in an Error Message I need to  provide the user an hyperlink , clicking on which will redirect him to the List settings page(/_layouts/listedit.aspx?) for the current list.

    How can I do this in code


    With Thanks and Regards, Azra

כל התגובות

  • יום שלישי 01 מאי 2012 15:30
     
     

    You can add code to the dialog to add redirection logic. Check this article 

    http://www.mssharepointtips.com/tip.asp?id=1094


    Regards,
    Milan Chauhan

  • יום שלישי 01 מאי 2012 15:35
     
      קוד כלול

    Thanks Milan, 

    But  My requirement is to extract / from List Edit url from SPList object

    Something like

     aMessage.Append("<p>You are not Authorized to access requested List view, Please Change the Settings for you:</p>");
                                                                    
    aMessage.Append("<a href ='" + SPContext.Current.List.()Listsetting url + "'>" + "</a>");
    

    Thanks


    With Thanks and Regards, Azra

  • יום שלישי 01 מאי 2012 16:10
     
     תשובה קוד כלול

    Hello Azra,

    It is quite simple. I dont have access to the environment so this exact line may not work. Idea is to:

    a) Get the URL of the web containing the list

    b) Append the string "/_layouts/listedit.aspx?List="

    c) Get the url encoded GUID of the List

    aMessage.Append("<a href ='" + SPContext.Current.Web.URL+"/_layouts/listedit.aspx?List="+Server.UrlEncode(SPContext.Current.List.ID.ToString())+ "'>" + "</a>");

    Hope this helps...

    -Sangeetha

    • סומן כתשובה על-ידי Azra SharePoint יום רביעי 02 מאי 2012 16:14
    •  
  • יום רביעי 02 מאי 2012 16:15
     
     

    Thanks Sangeetha, you saved my life


    With Thanks and Regards, Azra