Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Sunday, January 15, 2012

Sample Code Writing an inline Coding within a Master Page.


<div runat= "server">
                               <%
                                      
                               string strTitle = "";
                              
                              
                               Page.Response.Write("<table>");
                       SPWeb currentWeb = SPControl.GetContextWeb(Context);
                       SPList PrasadInlineList = currentWeb.Lists["PrasadInline"];
                       SPListItemCollection PrasadInlineListColl = PrasadInlineList.Items;
                       foreach (SPListItem PrasadInlineListItem in PrasadInlineListColl)
                       {
                           if (PrasadInlineListItem["Title"] != null)
                           {
                               strTitle = PrasadInlineListItem["Title"].ToString();
                           }
                           else
                               strTitle = "--";
                                              Page.Response.Write("<tr>");
                               Page.Response.Write("<td>");
                               Page.Response.Write("<span>");
                                              Page.Response.Write(strTitle);
                                              Page.Response.Write("</span>");
                           Page.Response.Write("</td>");
                           Page.Response.Write("</tr>");
                   
                       }
                       Page.Response.Write("</table>");
                               %></div >

No comments:

Post a Comment