I want to change the title of the web part in the runtime. I have a scenario where I need to display the username on the title of the webpart. eg: the web part title as "Welcome Ram"
You can add a simple label inside of your web part like:
<asp:Label runat="server" ID="LabelWelcome"></asp:Label>
And in the page load method in code behind set the text of that label like:
this.LabelWelcome.Text = "Welcome " + SPContext.Current.Web.CurrentUser.Name;
Then just set
Chrome Type property to
None in web part settings, so web part won't show it's real title :)