本文整理汇总了C#中System.Web.UI.WebControls.WebParts.WebPart.ResolveClientUrl方法的典型用法代码示例。如果您正苦于以下问题:C# WebPart.ResolveClientUrl方法的具体用法?C# WebPart.ResolveClientUrl怎么用?C# WebPart.ResolveClientUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.WebParts.WebPart
的用法示例。
在下文中一共展示了WebPart.ResolveClientUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 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);
//.........这里部分代码省略.........