servicepathconverter.cs
来自「AJAX 应用 实现页面的无刷新」· CS 代码 · 共 36 行
CS
36 行
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
using System;
using System.ComponentModel;
using System.Web.UI;
using System.Web;
namespace AjaxControlToolkit
{
public class ServicePathConverter : StringConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
string strValue = (string)value;
if (string.IsNullOrEmpty(strValue))
{
HttpContext currentContext = HttpContext.Current;
if (currentContext != null)
{
return currentContext.Request.FilePath;
}
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?