本文整理汇总了C#中System.Web.UI.WebControls.XmlDataSource类的典型用法代码示例。如果您正苦于以下问题:C# XmlDataSource类的具体用法?C# XmlDataSource怎么用?C# XmlDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlDataSource类属于System.Web.UI.WebControls命名空间,在下文中一共展示了XmlDataSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (System.Configuration.ConfigurationManager.AppSettings["siteId"] != null)
{
Microsite.SiteUtils.siteId = System.Configuration.ConfigurationManager.AppSettings["siteId"];
}
if (System.Configuration.ConfigurationManager.AppSettings["domainKey"] != null)
{
Microsite.SiteUtils.domainKey = System.Configuration.ConfigurationManager.AppSettings["domainKey"];
}
if (System.Configuration.ConfigurationManager.AppSettings["domainName"] != null)
{
Microsite.SiteUtils.domainName = System.Configuration.ConfigurationManager.AppSettings["domainName"];
}
if (System.Configuration.ConfigurationManager.AppSettings["shortKey"] != null)
{
Microsite.SiteUtils.shortKey = System.Configuration.ConfigurationManager.AppSettings["shortKey"];
}
if (System.Configuration.ConfigurationManager.AppSettings["longKey"] != null)
{
Microsite.SiteUtils.longKey = System.Configuration.ConfigurationManager.AppSettings["longKey"];
}
XmlDataSource xds = new XmlDataSource();
xds.DataFile = "skynet.xml";
xds.XPath = "/site";
repeaterXML.DataSource = xds;
repeaterXML.DataBind();
}
}
开发者ID:scopes,项目名称:microsite,代码行数:34,代码来源:MasterPage.master.cs
示例2: Xml_Data1_ItemDataBound
protected void Xml_Data1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
XmlDataSource xds = new XmlDataSource();
xds.DataFile = (e.Item.DataItem as feed).url;
xds.XPath = "rss/channel";
Repeater Xml_Data2 = e.Item.FindControl("Xml_Data2") as Repeater;
Xml_Data2.DataSource = xds;
Xml_Data2.DataBind();
}
开发者ID:JesperPetersenDk,项目名称:web-integrator-opgaver,代码行数:9,代码来源:nyheder.aspx.cs
示例3: AddRewriteNameSpaceForXslt
/// <summary>
/// Adds the rewrite namespace so that it can be used from within XSLT.
/// </summary>
/// <param name="xmlDataSource">The XML data source.</param>
public static void AddRewriteNameSpaceForXslt(XmlDataSource xmlDataSource)
{
if (_rewriteService == null)
_rewriteService = new RewriteService();
if (xmlDataSource.TransformArgumentList == null)
xmlDataSource.TransformArgumentList = new XsltArgumentList();
xmlDataSource.TransformArgumentList.AddExtensionObject("dc:urlRewrite", _rewriteService);
}
开发者ID:montyclift,项目名称:dashcommerce-3,代码行数:13,代码来源:RewriteService.cs
示例4: LeftMenu_ItemDataBound
protected void LeftMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
XmlDataSource xmlDSSubMenu = new XmlDataSource();
xmlDSSubMenu.EnableCaching = false;
xmlDSSubMenu.Data = xmlDSMenu.Data;
xmlDSSubMenu.XPath = @"siteMap/menu[" + (e.Item.ItemIndex + 1).ToString() + "]/subMenu/menu";
((Repeater)e.Item.FindControl("RepaterDate2")).DataSource = xmlDSSubMenu;
((Repeater)e.Item.FindControl("RepaterDate2")).DataBind();
}
开发者ID:yangkai1992,项目名称:sz1card1,代码行数:9,代码来源:Left.aspx.cs
示例5: XmlDataSourceConfigureDataSourceForm
public XmlDataSourceConfigureDataSourceForm(IServiceProvider serviceProvider, XmlDataSource xmlDataSource) : base(serviceProvider)
{
this._xmlDataSource = xmlDataSource;
this.InitializeComponent();
this.InitializeUI();
this.DataFile = this._xmlDataSource.DataFile;
this.TransformFile = this._xmlDataSource.TransformFile;
this.XPath = this._xmlDataSource.XPath;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:XmlDataSourceConfigureDataSourceForm.cs
示例6: Index
//
// GET: /ReadBook/
public ActionResult Index()
{
XmlDataSource xds = new XmlDataSource();
DataSet ds = new DataSet();
ds.ReadXml(@"C:\Projects\BookReader\BookReader\Files\Prod\005_Iqan.xml");
ViewBag.BookId = new SelectList(BookManager.GetAll(), "Id", "Title");
return View(new ReadBookViewModel());
}
开发者ID:imanf,项目名称:BookReader,代码行数:13,代码来源:ReadBookController.cs
示例7: Index
public ActionResult Index()
{
var doc = new XmlDocument();
doc.Load(this.Server.MapPath("~/Areas/TreePanel_Loaders/Content/authors.xml"));
XmlDataSource xmldataSource = new XmlDataSource();
xmldataSource.Data = doc.OuterXml;
xmldataSource.ID = DateTime.Now.Ticks.ToString(); // unique ID is required
return View(xmldataSource);
}
开发者ID:extnet,项目名称:Ext.NET.Examples.MVC,代码行数:11,代码来源:XML_File_LoadingController.cs
示例8: MontaNoticia
//TODO: Acho melhor assim. *adsneris
//protected void MontaNoticia(object sender, EventArgs e)
//{
// RssBO rssBO = new RssBO();
// BaseVO rssVO = new RssVO();
// Button b = (Button)sender;
// rssVO.Campo("time").Valor = b.ID;
// rssVO = rssBO.ObterDadosVOPorCampo("time", rssVO);
// Noticia(rssVO.Campo("link").Valor.ToString());
//}
protected void MontaNoticia(string rss)
{
XmlDataSource XmlDataSource1 = new XmlDataSource();
XmlDataSource1.DataFile = rss;
XmlDataSource1.XPath = "rss/channel/item";
DataList_Noticias.DataSource = XmlDataSource1;
DataList_Noticias.DataBind();
DataList_Noticias.Visible = true;
DataList_Noticias.SelectedIndex = -1;
}
开发者ID:JulianRSena,项目名称:projeto-suajogada,代码行数:21,代码来源:Noticia.aspx.cs
示例9: XmlDataSourceView
public XmlDataSourceView (XmlDataSource owner, string name, XmlNodeList nodes)
: base (owner, name)
{
// Why do they pass owner?
this.name = name;
this.nodes = new ArrayList (nodes.Count);
foreach (XmlNode node in nodes) {
if (node.NodeType == XmlNodeType.Element)
this.nodes.Add (node);
}
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:XmlDataSourceView.cs
示例10: GetMenuDataSource
/// <summary>
/// Carrega os itens do menu conforme perfil logado
/// </summary>
/// <param name="menu"></param>
/// <param name="serverMapPath"></param>
/// <returns></returns>
XmlDataSource GetMenuDataSource(string menu, string serverMapPath)
{
XmlDataSource objData = new XmlDataSource();
objData.XPath = "siteMap/siteMapNode";
switch (menu)
{
case "Administrador": //Caso seja o perfil Administrador carrega o perfil setado no xml
objData.DataFile = serverMapPath + @"\App_Data\Administrador.sitemap";
break;
default:
break;
}
objData.DataBind();
return objData;
}
开发者ID:danygolden,项目名称:gianfratti,代码行数:21,代码来源:Menu.ascx.cs
示例11: loadMenu
private void loadMenu()
{
List<CATEGORY> categories = ApplicationContext.Current.Categories.GetCategoryListByCampaign(CampaignID);
string path = Context.Server.MapPath(Configuration.XmlPath);
string culture = String.Empty;
if (Session["Culture"] != null)
{
culture = Session["Culture"].ToString();
}
String filename = XmlUtil.CreateCategoriesXml(categories, CampaignID, path, culture);
if (!String.IsNullOrEmpty(filename))
{
XmlDataSource menuDataSource = new XmlDataSource();
menuDataSource.XPath = "Node/Menu";
menuDataSource.DataFile = filename;
menuCat.DataSource = menuDataSource;
menuCat.DataBind();
}
}
开发者ID:gertgjoka,项目名称:fashion-commerce,代码行数:19,代码来源:CategoryMenu.ascx.cs
示例12: GetDesignTimeXmlDataSource
internal System.Web.UI.WebControls.XmlDataSource GetDesignTimeXmlDataSource(string viewPath)
{
System.Web.UI.WebControls.XmlDataSource source = new System.Web.UI.WebControls.XmlDataSource {
EnableCaching = false,
Data = this.XmlDataSource.Data,
Transform = this.XmlDataSource.Transform,
XPath = string.IsNullOrEmpty(viewPath) ? this.XmlDataSource.XPath : viewPath
};
if (this.XmlDataSource.DataFile.Length > 0)
{
if (this._mappedDataFile == null)
{
this._mappedDataFile = UrlPath.MapPath(base.Component.Site, this.XmlDataSource.DataFile);
}
source.DataFile = this._mappedDataFile;
if (!File.Exists(source.DataFile))
{
return null;
}
}
else if (source.Data.Length == 0)
{
return null;
}
if (this.XmlDataSource.TransformFile.Length > 0)
{
if (this._mappedTransformFile == null)
{
this._mappedTransformFile = UrlPath.MapPath(base.Component.Site, this.XmlDataSource.TransformFile);
}
source.TransformFile = this._mappedTransformFile;
if (!File.Exists(source.TransformFile))
{
return null;
}
}
return source;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:38,代码来源:XmlDataSourceDesigner.cs
示例13: Initialize
public override void Initialize(IComponent component)
{
ControlDesigner.VerifyInitializeArgument(component, typeof(System.Web.UI.WebControls.XmlDataSource));
base.Initialize(component);
this._xmlDataSource = (System.Web.UI.WebControls.XmlDataSource) component;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:XmlDataSourceDesigner.cs
示例14: SelectFromXmlDataSourceEditUpdate
public void SelectFromXmlDataSourceEditUpdate()
{
Grid grid = new Grid();
SetupGrid(grid);
XmlDataSource ds = new XmlDataSource();
ds.XPath = "//Language//*";
ds.ID = "test1";
ds.DataFile = Path + "\\WebGridMessages.xml";
Testpage.Controls.Add(ds);
grid.DataSourceId = ds.ID;
grid["LanguageID"].Primarykey = true;
grid.EditIndex = "Norwegian";
grid.DisplayView = DisplayView.Detail;
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
string text = "T:" + DateTime.Now.Ticks;
grid.Rows[0]["PagerPrefix"].Value = text;
grid.BeforeUpdateInsert += grid_BeforeUpdateInsert;
grid.RaisePostBackEvent("RecordUpdateClick!Norwegian!False");
grid.RenderControl(gridwriter);
Assert.Greater(grid.Rows.Count, 1, sb.ToString());
Assert.LessOrEqual(grid.SystemMessage.Count, 1);
string filecontent = System.IO.File.ReadAllText(Path + "\\WebGridMessages.xml");
Assert.Greater(filecontent.IndexOf(text), 0);
/* string[] triggerStrings = new[]
{
"Forrige side",
"RecordCancelClick!Norwegian!",
"RecordUpdateClick!Norwegian!False"
};
string content = sb.ToString();
foreach (string part in triggerStrings)
{
int res = content.IndexOf(part);
Assert.Greater(res, -1, part + Environment.NewLine + content);
}
*/
}
开发者ID:webgrid,项目名称:WebGrid,代码行数:43,代码来源:DataSourceControl.cs
示例15: SelectFromXmlDataSourceEdit
public void SelectFromXmlDataSourceEdit()
{
Grid grid = new Grid();
SetupGrid(grid);
XmlDataSource ds = new XmlDataSource();
ds.XPath = "//Language//*";
ds.ID = "test1";
ds.DataFile = Path + "\\WebGridMessages.xml";
Testpage.Controls.Add(ds);
grid.DataSourceId = ds.ID;
grid["LanguageID"].Primarykey = true;
grid.RaisePostBackEvent("RecordClick!!Norwegian");
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
grid.RenderControl(gridwriter);
Assert.AreEqual(grid.MasterTable.Rows.Count, 1);
Assert.LessOrEqual(grid.SystemMessage.Count, 1);
string[] triggerStrings = new[]
{
"Forrige side",
"RecordCancelClick!Norwegian!",
"RecordUpdateClick!Norwegian!False"
};
string content = sb.ToString();
foreach (string part in triggerStrings)
{
int res = content.IndexOf(part);
Assert.Greater(res, -1, part + Environment.NewLine + content);
}
}
开发者ID:webgrid,项目名称:WebGrid,代码行数:35,代码来源:DataSourceControl.cs
示例16: SelectFromXmlDataSourceControlSearch
public void SelectFromXmlDataSourceControlSearch()
{
Grid grid = new Grid();
SetupGrid(grid);
XmlDataSource ds = new XmlDataSource();
ds.XPath = "//Language//*";
ds.ID = "test1";
ds.DataFile = Path + "\\WebGridMessages.xml";
Testpage.Controls.Add(ds);
grid.DataSourceId = ds.ID;
grid["LanguageID"].Primarykey = true;
grid.Search = "\"a\" -t";
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
grid.RenderControl(gridwriter);
Assert.AreEqual(grid.MasterTable.Rows.Count, 6);
}
开发者ID:webgrid,项目名称:WebGrid,代码行数:20,代码来源:DataSourceControl.cs
示例17: SelectFromXmlDataSourceControl
public void SelectFromXmlDataSourceControl()
{
Testpage.Controls.Clear();
Grid grid = new Grid();
SetupGrid(grid);
XmlDataSource ds = new XmlDataSource();
ds.XPath = "//Language//*";
ds.ID = "test1";
ds.DataFile = Path + "\\WebGridMessages.xml";
Testpage.Controls.Add(ds);
grid.DataSourceId = ds.ID;
grid["LanguageID"].Primarykey = true;
grid["LanguageID"].HyperLinkColumn = true;
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
grid.RenderControl(gridwriter);
//It is converted to from XmlDataSource to EnumerableDataSource
Assert.AreEqual(grid.MasterTable.DataSourceType, DataSourceControlType.EnumerableDataSource);
Assert.Greater(grid.MasterTable.Rows.Count, 1);
string[] triggerStrings = new[]
{
"Fehler beim Speichern mehrerer",
"Forrige side",
"RecordDeleteClick!Danish",
"ExcelExportClick",
"RecordClick!LanguageID!Norwegian",
};
string content = sb.ToString();
foreach (string part in triggerStrings)
{
int res = content.IndexOf(part);
Assert.Greater(res, -1, part + Environment.NewLine + content);
}
}
开发者ID:webgrid,项目名称:WebGrid,代码行数:38,代码来源:DataSourceControl.cs
示例18: OnLoad_WithDataSource
public void OnLoad_WithDataSource ()
{
XmlDataSource ds = new XmlDataSource ();
ds.ID = "mono";
TestBaseDataList bdl = new TestBaseDataList ();
Page p = new Page ();
bdl.Page = p;
p.Controls.Add (ds);
p.Controls.Add (bdl);
bdl.DataSourceID = "mono";
Assert.IsTrue (bdl.IsDataBoundByDataSourceId, "IsBoundUsingDataSourceID");
Assert.IsTrue (bdl.EnableViewState, "EnabledViewState");
Assert.IsFalse (bdl.Page.IsPostBack, "IsPostBack");
bdl.BaseOnLoad (EventArgs.Empty);
Assert.IsTrue (bdl.IsInitialized, "IsInitialized");
Assert.IsTrue (bdl.RequiresDataBind, "RequiresDataBind");
}
开发者ID:nobled,项目名称:mono,代码行数:17,代码来源:BaseDataListTest.cs
示例19: PostBackFireEvents_3
public static void PostBackFireEvents_3 (Page p)
{
TreeView tv = new TreeView ();
tv.TreeNodeCollapsed += new TreeNodeEventHandler (tv_TreeNodeCollapsed);
tv.TreeNodeExpanded +=new TreeNodeEventHandler(tv_TreeNodeExpanded);
tv.EnableClientScript = false;
tv.ID = "treeview1";
XmlDataSource xmlds = new XmlDataSource ();
xmlds.EnableCaching = false;
xmlds.Data = xmlDataBind;
tv.DataSource = xmlds;
tv.DataBind ();
tv.Nodes[0].Checked = true;
tv.Nodes[0].ChildNodes[0].Selected = false;
tv.Nodes[0].ChildNodes[0].Expanded = true;
tv.Nodes[0].ChildNodes[0].ChildNodes[0].PopulateOnDemand = false;
tv.Nodes[0].ChildNodes[0].ChildNodes[1].ShowCheckBox = true;
tv.Nodes[0].ChildNodes[1].SelectAction = TreeNodeSelectAction.SelectExpand;
p.Form.Controls.Add (tv);
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:22,代码来源:TreeViewTest.cs
示例20: XmlDataSourceView
public XmlDataSourceView (XmlDataSource owner, string name)
: base (owner, name)
{
this.owner = owner;
}
开发者ID:nobled,项目名称:mono,代码行数:5,代码来源:XmlDataSourceView.cs
注:本文中的System.Web.UI.WebControls.XmlDataSource类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论