获得控件对应的字段名(eg:txt_TheName ==> TheName)
2015-12-07 14:49:15 访问(1367) 赞(0) 踩(0)
/// <summary>
/// 获得控件对应的字段名(eg:txt_TheName ==> TheName)
/// </summary>
/// <param name="ctrlName">txt_TheName</param>
/// <returns>TheName</returns>
public static string GetDataColumnName(string ctrlName)
{
if (ctrlName == null)
return "";
int idx = ctrlName.IndexOf('_');
if (idx == -1)
return ctrlName;
return ctrlName.Substring(idx + 1);
}
标签:
获得控件对应的字段名(eg:txt_TheName ==> TheName) 


上一条:
下一条:
相关评论
发表评论