.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

adding tags to the head section with SPMobilePage.OnPreInit ?

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :SharePoint
 

The OnPreInit method's remark says :"This override adds <meta> tags to the head section of the page."

Does anybody have any clue how to do it?



View Complete Post


More Related Resource Links

Adding meta element under head tag through javascript

  

I have created an aspx page in sharepoint desinger with one webpart zone containing content editor webpart. 

now i want to add the meta elements like <meta name="keywords" content="a,b,c"/> through javascript. 

I have written below mentioned javascript in content editor webpart but its not coming in head section. 

<script type="text/javascript"> var meta =document.createElement('meta');

// set properties

meta.name = "keywords"; meta.content = "A,b,c";

// now add the meta element to the head

document.getElementsByTagName('head')[0].appendChild(meta);

}</script>

Anyone has any idea does my approach is right or wrong?


Thanks -NK

inline expression or binding expression in the server head section

  
Hello, I write inline expression and binding expression in the server head section:<head runat="server"> <link rel="stylesheet" type="text/css" href="<%= Request.ApplicationPath %>themes/style1.css" /> <link rel="stylesheet" type="text/css" href="<%# Request.ApplicationPath %>themes/style2.css" /> <link rel="stylesheet" type="text/css" href="<%= ResolveUrl("~") %>themes/style3.css" /> <script type="text/javascript" src="<%= Request.ApplicationPath %>js/jwork.js"></script> </head> protected void Page_Load(object sender, EventArgs e) { Page.Header.DataBind(); }  But both kinds of expression aren't parsed or executed except the  ResovleUrl menthod. The html renders like this: <head><link rel="stylesheet" type="text/css" href="&lt;%= Request.ApplicationPath  %>themes/style1.css" /><link rel="stylesheet" type="text/css" href="&lt;%# Request.ApplicationPath  %>themes/style2.css" />    <link rel="stylesheet" type="text/css" href="/themes/style3.css"  /> 

Profile page throwing an error after adding some "ask me about" tags

  
After adding some "ask me about" tags my profile page is throwing an error. To be more precise the AskMeAbout WebPart ist throwing a thread aborted exception and I don't understand the reason for this error. After removing the tags the sites works again. Some tags work but after trying some other tags the profile page is broken again. Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler(). Exception information: Exception information: Microsoft.SharePoint.WebPartPages.WebPartException: Thread was being aborted. ---> System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.SharePoint.Portal.WebControls.AskMeAboutWebPart.RenderValues(HtmlTextWriter writer, Int32 startIndex, Int32 endIndex) at Microsoft.SharePoint.Portal.WebControls.AskMeAboutWebPart.RenderWebPart(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter output, WebPart part) - -- End of inner exception stack trace --- at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter output, WebPart part) at Microsoft.SharePoint.WebPartPages.SPChrome.RenderWebPart(HtmlTextWriter output, WebPart part) at Microsoft.SharePoint.WebPartPages.WebPartZone.RenderZoneCell(HtmlTex

sharepoint designer keeps adding unwanted tags

  
I have a page where I want this code:
<p class="AlignLeft">ASPvalidation<br />
<asp:ValidationSummary id="vsErrors" Runat="server" CssClass="AlertText" DisplayMode="BulletList" EnableClientScript="True" HeaderText="Error Summary" ValidationGroup="loginValidationGroup" />
<asp:CustomValidator id="cvAuthentication" Runat="server" Display="None" EnableClientScript="False" ErrorMessage="Login ID or Password Is Invalid" OnServerValidate="cvAuthentication_ServerValidate" ValidationGroup="loginValidationGroup" />
</p>





But each time I press save SPD adds a <p> and hoses my code to this..................
<p class="AlignLeft">ASPvalidation<br />
<asp:ValidationSummary id="vsErrors" Runat="server" CssClass="AlertText" DisplayMode="BulletList" EnableClientScript="True" HeaderText="Error Summary" ValidationGroup="loginValidationGroup" />
<p>
<asp:CustomValidator id="cvAuthentication" Runat="server" Display="None" EnableClientScript="False" ErrorMessage="Login ID or Password Is Invalid" OnServe

Adding links to top section

  
Tired searching but didnt seem to come up with anything. I was wondering how do i add a link to the top of a site (Not MySite). I wanted to place a link at the very to of the site after the browse and page links. How do I do this?

I like It and Tags & Notes section are not appearing in MySite, How they appear?

  

Hi,

I am created a MySite site collection on a different port.

MySite is created but on the top right corner I am not getting the I Like It, Tags & Notes section

to enable them what extra should I do?

Thanks,

 


reddy

Removing/Adding in Ribbon.PublishTab.Publishing section

  

Hi,

I'm dealing with ribbon customization and it's working quite well. But when I try to change (remove or add) buttons to Ribbon.PublishTab.Publishing it is not working:

<CustomAction Id="

Dynamicaly Adding Object tag to MasterPage Body section

  

Using VS 2008 / .NET 3.5 / C#.

To load an external control I have to add an object tag to the body of my pages (<object classid=......>).

However, I do not want this tag to be on all pages, just the one aspx where it is needed. Since all my aspx files use the MasterPage, the only body section is in the MasterPage. Is there a programmatic way to add the object tag only in one aspx file at run time?

I know I can add an Id and runat=server in the body tag of the MasterPage, and refer to the body by its Id, but do not know how to add the object tag.

Thanks in advance.


Different head and meta tag content on each content page

  

Hi,

 I am using master pages.  I want to put different head and meta (description, keywords) on each content page. How can this be done to make my site better designed for search engines.

 

Thanks

Andrew Welch

 

Abtec Network Systems


Why don't my meta tags show up?

  

I am trying to insert meta tags into my VWD 2008 Express web site.  After reading other postings, I placed the following code into my Default.aspx Page_Load method:

HtmlMeta metaTag = new HtmlMeta();

metaTag.Name = "Keywords";

metaTag.Content = "Pittsford, Autumn, Erie, canal";

Header.Controls.Add(metaTag);

But when I view the "View Souce" code on my web page, I cannot see these meta tags.  Where am I going wrong?  Thank you.

Don


SEO meta tags - SharePoint Designer

  

I need to add the title and description tags for SEO. However,I want this meta tag to be scripted in the master page so that the title and descriptions are picked up when added to each page.

 


SharePoint Architect

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Adding Rows in GridView without using a Database

  
This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Adding Dynamic Rows in GridView with TextBoxes

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

  
The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend