本文整理汇总了C#中XhtmlMobileTextWriter.EncodeUrlInternal方法的典型用法代码示例。如果您正苦于以下问题:C# XhtmlMobileTextWriter.EncodeUrlInternal方法的具体用法?C# XhtmlMobileTextWriter.EncodeUrlInternal怎么用?C# XhtmlMobileTextWriter.EncodeUrlInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XhtmlMobileTextWriter
的用法示例。
在下文中一共展示了XhtmlMobileTextWriter.EncodeUrlInternal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderHrefValue
// Writes the href value for RenderBeginLink, depending on whether the target is a new form on the
// current page or a standard url (e.g., a new page).
private void RenderHrefValue (XhtmlMobileTextWriter writer, String target) {
bool appendCookielessDataDictionary = PageAdapter.PersistCookielessData &&
!target.StartsWith("http:", StringComparison.Ordinal) &&
!target.StartsWith("https:", StringComparison.Ordinal);
bool queryStringWritten = false;
// ASURT 144021
if (target == null || target.Length == 0) {
target = Page.Response.ApplyAppPathModifier(Control.TemplateSourceDirectory);
}
if (target.StartsWith(Constants.FormIDPrefix, StringComparison.Ordinal)) {
RenderFormNavigationHrefValue (writer, target);
appendCookielessDataDictionary = false;
}
else {
// For page adapter Control = null.
if (Control != null) {
target = Control.ResolveUrl(target);
}
// ASURT 147179
if ((String)Device["requiresAbsolutePostbackUrl"] == "true"
&& IsRelativeUrl(target)) {
String templateSourceDirectory = Page.TemplateSourceDirectory;
String prefix = writer.EncodeUrlInternal(Page.Response.ApplyAppPathModifier(Page.TemplateSourceDirectory));
if (prefix[prefix.Length - 1] != '/') {
prefix = prefix + '/';
}
target = prefix + target;
}
if ((String)Device[XhtmlConstants.SupportsUrlAttributeEncoding] != "false") {
writer.WriteEncodedText (target);
}
else {
writer.Write (target);
}
queryStringWritten = target.IndexOf ('?') != -1;
}
if (appendCookielessDataDictionary) {
RenderCookielessDataDictionaryInQueryString (writer, queryStringWritten);
}
}