/// 将表单中的控件元素值连接起来
/// </summary>
/// <param name="page">要操作的页面</param>
/// <param name="fromName">操作页面的表单名</param>
/// <param name="splitName">分隔符</param>
public static string getFormText(System.Web.UI.Page page, string fromName,string splitName)
{
string rs = "";
foreach (System.Web.UI.Control ctl in page.FindControl(fromName).Controls)
{
if (ctl.GetType().Name == "TextBox")
{
rs += "this." + ctl.ID.ToString() + ".Text.Trim()+"+"""+splitName+""+";
}
else if (ctl.GetType().Name == "DropDownList")
{
rs += "this." + ctl.ID.ToString() + ".SelectedValue+" + """ + splitName + ""+";
}
}
rs = rs.Substring(0, rs.Length - 1);
return rs;
}