本文整理汇总了C#中System.Web.UI.HtmlTextWriter.WriteEncodedUrl方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.WriteEncodedUrl方法的具体用法?C# HtmlTextWriter.WriteEncodedUrl怎么用?C# HtmlTextWriter.WriteEncodedUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.WriteEncodedUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPostBackEvent
protected void RenderPostBackEvent(HtmlTextWriter writer, string target, string argument, string softkeyLabel, string text, string postUrl, string accessKey, bool encode)
{
string str = encode ? "&" : "&";
bool flag = !string.IsNullOrEmpty(postUrl);
writer.WriteBeginTag("a");
writer.Write(" href=\"");
string url = null;
if (!flag)
{
if (base.Browser["requiresAbsolutePostbackUrl"] == "true")
{
url = base.Page.Response.ApplyAppPathModifier(base.Page.Request.CurrentExecutionFilePath);
}
else
{
url = base.Page.RelativeFilePath;
}
}
else
{
url = postUrl;
base.Page.ContainsCrossPagePost = true;
}
writer.WriteEncodedUrl(url);
writer.Write("?");
if (this.ClientState != null)
{
ICollection is2 = base.Page.DecomposeViewStateIntoChunks();
if (is2.Count > 1)
{
writer.Write("__VIEWSTATEFIELDCOUNT=" + is2.Count + str);
}
int num = 0;
foreach (string str4 in is2)
{
writer.Write("__VIEWSTATE");
if (num > 0)
{
writer.Write(num.ToString(CultureInfo.CurrentCulture));
}
writer.Write("=" + HttpUtility.UrlEncode(str4));
writer.Write(str);
num++;
}
}
if (flag)
{
writer.Write("__PREVIOUSPAGE");
writer.Write("=" + Page.EncryptString(base.Page.Request.CurrentExecutionFilePath));
writer.Write(str);
}
writer.Write("__EVENTTARGET=" + HttpUtility.UrlEncode(target));
writer.Write(str);
writer.Write("__EVENTARGUMENT=" + HttpUtility.UrlEncode(argument));
string queryString = this.QueryString;
if (!string.IsNullOrEmpty(queryString))
{
writer.Write(str);
writer.Write(queryString);
}
writer.Write("\"");
if (!string.IsNullOrEmpty(accessKey))
{
writer.WriteAttribute("accessKey", accessKey);
}
writer.Write(">");
writer.Write(text);
writer.WriteEndTag("a");
}