I need that some html in the area in the asp.net page that i am coding, is changed according to a string variable. I was thinking about creating a label, and then change the
You can also use pageMethods in asp.net. So that you can call javascript functions from asp.net functions. E.g.
[WebMethod]
public static string showTxtbox(string name)
{
return showResult(name);
}
public static string showResult(string name)
{
Database databaseObj = new Database();
DataTable dtObj = databaseObj.getMatches(name);
string result = "" +
"" +
"Name " +
"Company Name " +
"Phone "+
" ";
for (int i = 0; i < dtObj.Rows.Count; i++)
{
result += " " + Convert.ToString(dtObj.Rows[i]["name"]) + " " +
"" + Convert.ToString(dtObj.Rows[i]["customerCompany"]) + " " +
""+Convert.ToString(dtObj.Rows[i]["Phone"])+" "+
" ";
}
result += "
";
return result;
}
Here above code is written in .aspx.cs page. Database is another class. In showResult() function I've called javascript's link() function. Result is displayed in the form of table.