Display Site Name - InfoPath Dev
in

InfoPath Dev

Display Site Name

Last post 11-13-2008 05:09 AM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-13-2008 03:12 AM

    Display Site Name

    Hi All,

    I'm very new to InfoPath forms.

    I want to display name of the site from which the form is invoked.

    Any pointers would be a great help.

     Thanks

    Amit

  • 11-13-2008 05:09 AM In reply to

    Hi, Use the following code lines to get the site name. Note: This code works if the url is in the form of http://<servername>/<sitename>/.... Ex: http://server3/test/test1/Forms/template.xsn We will get the value ‘test’ if we use the following code lines. 

    string url = thisXDocument.Solution.URI;

      url = ((url.Remove(0, url.Substring(0, url.IndexOf("//") + 2).Length)).Remove(0, url.Substring(0, url.IndexOf("/") + 3).Length)).Substring(0, url.IndexOf("/") - 1);    

     

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.