TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Display Calendar view using sharepoint in C# script.
Sagar Pardeshi
Jun 23
2014
Code
3.5
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<script type=
"text/c#"
runat=
"server"
>
string
strListName =
"Courses"
;
string
strView =
"All Items"
;
protected
void
Page_Load(
object
sender, EventArgs e)
{
GenerateListViewWp();
}
void
btnview_Click(
object
sender, EventArgs e)
{
string
strTitle =
"Course Calendar"
;
SPWeb oWeb = SPContext.Current.Web;
SPList oList = oWeb.Lists[strListName];
SPView View = oList.Views[strView];
ListViewWebPart wp =
new
ListViewWebPart();
wp.ListName = oList.ID.ToString(
"B"
).ToUpper();
wp.ViewGuid = oList.Views[View].ID.ToString(
"B"
).ToUpper();
wp.ID =
this
.ID +
"child"
;
////wp.Title = "";
wp.ViewType = ViewType.Calendar;
wp.GetDesignTimeHtml();
this
.PageCalendarDiv.Controls.Add(wp);
}
}
</script>
<div id=
"PageCalendarDiv"
runat=
"server"
>
</div>
Calendar view using sharepoint