Get QueryString Value in SharePoint webpart and pass that value to browser's title bar in the page Programatically

Advertisement

          Using "HtmlTitle" we can pass the browser's title bar in the Page. I am passing QueryString Value with Page url in the list, so first i am getting the Query String value and passing that value to "HtmlTitle ". The following is the code for getting QueryString Value and pass that value to title bar in the page.

 using System.Web.UI.HtmlControls

public string querystringvalue = string.Empty;
 protected void Page_Load(object sender, EventArgs e)
        {
                      //Getting Query String Value
                      querystringvalue = Convert.ToString(HttpContext.Current.Request.QueryString["value"]);
                       HtmlTitle tagTitle = new HtmlTitle();
                       tagTitle.Text = "querystringvalue ";
                       Page.Header.Controls.Remove(   
                          Page.Header.FindControl("PlaceHolderPageTitle").Parent);
                        Page.Header.Controls.Add(tagTitle);
        }
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments:

  1. I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. download UC mini

    ReplyDelete