本文整理汇总了C#中System.Web.UI.WebControls.WebParts.WebPartManager.GetExportUrl方法的典型用法代码示例。如果您正苦于以下问题:C# WebPartManager.GetExportUrl方法的具体用法?C# WebPartManager.GetExportUrl怎么用?C# WebPartManager.GetExportUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.WebParts.WebPartManager
的用法示例。
在下文中一共展示了WebPartManager.GetExportUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderMenuPopup
private void RenderMenuPopup(HtmlTextWriter writer, ICollection verbs, string clientID, WebPart associatedWebPart,
WebPartManager webPartManager) {
writer.AddAttribute(HtmlTextWriterAttribute.Id, clientID + "Menu");
writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
bool popupSpansFullExtent = true;
WebPartMenuStyle menuStyle = _menuUser.MenuPopupStyle;
if (menuStyle != null) {
menuStyle.AddAttributesToRender(writer, _menuUser as WebControl);
popupSpansFullExtent = menuStyle.Width.IsEmpty;
}
else {
// generate attributes corresponding to defaults on WebPartMenuStyle
writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "1");
writer.AddStyleAttribute(HtmlTextWriterStyle.BorderCollapse, "collapse");
}
if (popupSpansFullExtent) {
writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
}
writer.RenderBeginTag(HtmlTextWriterTag.Table);
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
bool isParentEnabled = associatedWebPart.Zone.IsEnabled;
foreach (WebPartVerb verb in verbs) {
Debug.Assert(verb != null);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
string alt;
if (associatedWebPart != null) {
alt = String.Format(CultureInfo.CurrentCulture, verb.Description, associatedWebPart.DisplayTitle);
}
else {
alt = verb.Description;
}
if (alt.Length != 0) {
writer.AddAttribute(HtmlTextWriterAttribute.Title, alt);
}
bool isEnabled = isParentEnabled && verb.Enabled;
// Special case help, export, etc.
if (verb is WebPartHelpVerb) {
Debug.Assert(associatedWebPart != null);
string resolvedHelpUrl =
((IUrlResolutionService)associatedWebPart).ResolveClientUrl(associatedWebPart.HelpUrl);
writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
if (isEnabled) {
writer.AddAttribute(HtmlTextWriterAttribute.Onclick,
"document.body.__wpm.ShowHelp('" +
Util.QuoteJScriptString(resolvedHelpUrl) +
"', " +
((int)associatedWebPart.HelpMode).ToString(CultureInfo.InvariantCulture) + ")");
}
}
else if (verb is WebPartExportVerb) {
Debug.Assert(associatedWebPart != null);
string exportUrl = webPartManager.GetExportUrl(associatedWebPart);
writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
if (isEnabled) {
writer.AddAttribute(HtmlTextWriterAttribute.Onclick,
"document.body.__wpm.ExportWebPart('" +
Util.QuoteJScriptString(exportUrl) +
((associatedWebPart.ExportMode == WebPartExportMode.All) ?
"', true, false)" :
"', false, false)"));
}
}
else {
string target = _menuUser.PostBackTarget;
writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
if (isEnabled) {
string eventArgument = verb.EventArgument;
if (associatedWebPart != null) {
eventArgument = verb.GetEventArgument(associatedWebPart.ID);
}
string submitScript = null;
if (!String.IsNullOrEmpty(eventArgument)) {
submitScript = "document.body.__wpm.SubmitPage('" +
Util.QuoteJScriptString(target) +
"', '" +
Util.QuoteJScriptString(eventArgument) +
"');";
_menuUser.Page.ClientScript.RegisterForEventValidation(target, eventArgument);
}
string clientClickScript = null;
if (!String.IsNullOrEmpty(verb.ClientClickHandler)) {
clientClickScript = "document.body.__wpm.Execute('" +
Util.QuoteJScriptString(Util.EnsureEndWithSemiColon(verb.ClientClickHandler)) +
"')";
}
//.........这里部分代码省略.........
示例2: RenderMenuPopup
private void RenderMenuPopup(HtmlTextWriter writer, ICollection verbs, string clientID, WebPart associatedWebPart, WebPartManager webPartManager)
{
writer.AddAttribute(HtmlTextWriterAttribute.Id, clientID + "Menu");
writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
bool isEmpty = true;
WebPartMenuStyle menuPopupStyle = this._menuUser.MenuPopupStyle;
if (menuPopupStyle != null)
{
menuPopupStyle.AddAttributesToRender(writer, this._menuUser as WebControl);
isEmpty = menuPopupStyle.Width.IsEmpty;
}
else
{
writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "1");
writer.AddStyleAttribute(HtmlTextWriterStyle.BorderCollapse, "collapse");
}
if (isEmpty)
{
writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
}
writer.RenderBeginTag(HtmlTextWriterTag.Table);
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
bool isEnabled = associatedWebPart.Zone.IsEnabled;
foreach (WebPartVerb verb in verbs)
{
string description;
writer.RenderBeginTag(HtmlTextWriterTag.Div);
if (associatedWebPart != null)
{
description = string.Format(CultureInfo.CurrentCulture, verb.Description, new object[] { associatedWebPart.DisplayTitle });
}
else
{
description = verb.Description;
}
if (description.Length != 0)
{
writer.AddAttribute(HtmlTextWriterAttribute.Title, description);
}
bool flag3 = isEnabled && verb.Enabled;
if (verb is WebPartHelpVerb)
{
string str2 = associatedWebPart.ResolveClientUrl(associatedWebPart.HelpUrl);
writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
if (flag3)
{
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "document.body.__wpm.ShowHelp('" + Util.QuoteJScriptString(str2) + "', " + ((int) associatedWebPart.HelpMode).ToString(CultureInfo.InvariantCulture) + ")");
}
}
else if (verb is WebPartExportVerb)
{
string exportUrl = webPartManager.GetExportUrl(associatedWebPart);
writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
if (flag3)
{
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "document.body.__wpm.ExportWebPart('" + Util.QuoteJScriptString(exportUrl) + ((associatedWebPart.ExportMode == WebPartExportMode.All) ? "', true, false)" : "', false, false)"));
}
}
else
{
string postBackTarget = this._menuUser.PostBackTarget;
writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
if (flag3)
{
string eventArgument = verb.EventArgument;
if (associatedWebPart != null)
{
eventArgument = verb.GetEventArgument(associatedWebPart.ID);
}
string str6 = null;
if (!string.IsNullOrEmpty(eventArgument))
{
str6 = "document.body.__wpm.SubmitPage('" + Util.QuoteJScriptString(postBackTarget) + "', '" + Util.QuoteJScriptString(eventArgument) + "');";
this._menuUser.Page.ClientScript.RegisterForEventValidation(postBackTarget, eventArgument);
}
string str7 = null;
if (!string.IsNullOrEmpty(verb.ClientClickHandler))
{
str7 = "document.body.__wpm.Execute('" + Util.QuoteJScriptString(Util.EnsureEndWithSemiColon(verb.ClientClickHandler)) + "')";
}
string str8 = string.Empty;
if ((str6 != null) && (str7 != null))
{
str8 = "if(" + str7 + "){" + str6 + "}";
}
else if (str6 != null)
{
str8 = str6;
}
else if (str7 != null)
{
str8 = str7;
}
if (verb is WebPartCloseVerb)
{
ProviderConnectionPointCollection providerConnectionPoints = webPartManager.GetProviderConnectionPoints(associatedWebPart);
//.........这里部分代码省略.........