kamagra how much to take

Open Up A SharePoint Web Conditionally

This method shows you how you can open up a web conditionally based on pre-existing text, such as whether it exists in a text box in this specific example.

  1. SPWeb web;
  2. if (this.TextBox.Trim() == string.Empty)
  3. {
  4.         web = SPControl.GetContextWeb(this.Context);
  5. }
  6. else
  7. {
  8.         SPSite site = new SPSite(new Uri(this.Page.Request.Url, this.TextBox.Text, true).ToString());
  9.         site.CatchAccessDeniedException = false;
  10.         web = site.OpenWeb();
  11. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>