ソースビュー |
コードのコピー
|
---|---|
<%@ Register Assembly="C1.Web.Wijmo.Controls.4" Namespace="C1.Web.Wijmo.Controls.C1EventsCalendar" TagPrefix="cc1" %> <%@ Register Assembly="C1.Web.Wijmo.Controls.4" Namespace="C1.Web.Wijmo.Controls.C1AppView" TagPrefix="cc1" %> |
<form> </form>
タグに移動します。このタグの間に次のマークアップを挿入します。追加するマークアップ
コードのコピー
|
|
---|---|
<asp:EntityDataSource ID="EventPlannerEntityDataSource" runat="server" OnContextCreating="EventPlannerEntityDataSource_ContextCreating" EntitySetName="Events"> </asp:EntityDataSource> <cc1:C1AppViewPage ID="C1AppViewPage1" runat="server" HeaderTitle="Event Calendar"> <Header ID="Header1" runat="server"> <Template> <a href="../Main.aspx" data-icon="back">Back</a> <h2>Event Calendar</h2> </Template> </Header> <Content ID="Content1" runat="server"> <Template> <cc1:C1EventsCalendar ID="C1EventsCalendar1" runat="server"> <DataStorage> <EventStorage DataSourceID="EventPlannerEntityDataSource"> <Mappings> <IdMapping MappingName="Id" /> <SubjectMapping MappingName="Subject" /> <StartMapping MappingName="Start" /> <EndMapping MappingName="End" /> <LocationMapping MappingName="Location" /> <DescriptionMapping MappingName="Description" /> </Mappings> </EventStorage> </DataStorage> </cc1:C1EventsCalendar> </Template> </Content> </cc1:C1AppViewPage> |
C# コードの書き方
C# |
コードのコピー
|
---|---|
using System; using System.Collections.Generic; using System.Data.Entity.Infrastructure; using System.Diagnostics; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using YourApplicationName.Models; |
ソースビュー |
コードのコピー
|
---|---|
protected void EventPlannerEntityDataSource_ContextCreating(object sender, EntityDataSourceContextCreatingEventArgs e) { var db = EventAction.GetEventDb(); e.Context = (db as IObjectContextAdapter).ObjectContext; } } |