1
我已经为使用jQuery的自动完成文本框编写了一个web方法。
我想将从此文本框公司选择的值分配给textbox,并将enquiryid分配给隐藏字段。从web方法为文本框和隐藏字段分配值
[WebMethod]
public static List<string> GetAutoCompleteData(string username)
{
// int usr = ((int)Session["orgid"]);
DbConnect objdbc = new DbConnect();
SqlConnection con = objdbc.openConnection();
List<string> result = new List<string>();
using (SqlCommand cmd = new SqlCommand("select DISTINCT top 10 Company from EnquiryMaster where Company LIKE '%'[email protected]+'%'", con))
{
// con.Open();
cmd.Parameters.AddWithValue("@SearchText", username);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
result.Add(dr["Company"].ToString());
}
return result;
}
}
你的问题是什么? –
除非您也发布前端代码,否则没有人可以给予适当的回应。 – nunespascal
从这个方法我得到了一系列记录在自动完成的文本框....从该系列我选择1,并进入文本框.......我想知道我将如何得到相同的值这是在自动完成文本框到另一个文本框在同一页 – user2147357