yes Michael
i have the div named lodinfo and no exception throwed out :)
here is the code
===========================
<body>
<form id="form1" runat="server">
<div><br />
<input type=text id="tx" onchange="getdata()" />
<input type=button onclick="getdata();" title="click" value="click" />
</div>
<div id="loadinfo"
style="visibility:hidden;position:absolute;left:0px;top:0px;background-color:Red;color:White;">Loading...</div>
<table id=tt1>
</table>
</form>
</body>
</html>
<script type="text/javascript" >
test._Default.onLoading=function(b){
var l = document.getElementById("loadinfo");
l.style.visibility = b ? "visible" : "hidden";
}
var tx_r=document.getElementById("tx");
function clear(){
while(tt1.rows.length!=0){
tt1.deleteRow();
}
}
function getdata(){
clear();
test._Default.getdata(tx_r.value,call);
}
function call(res)
{
for (var i=0;i<res.value.Tables[0].Rows.length;i++ ){
var tr=tt1.insertRow();
var td=tr.insertCell();
td.innerText=res.value.Tables[0].Rows[i]["PID"];
}
}
</script>
==================cs file=======
namespace test
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(test._Default));
}
[AjaxPro.AjaxMethod]
public System.Data.DataSet getdata(string row){
SqlConnection conn = new
System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings["ConnStr"]);
try
{
conn.Open();
}
catch (Exception e)
{
Response.Write(e);
}
string select;
select = "select top "+row+" PID from products";
SqlCommand cmd = new SqlCommand(select, conn);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);
return ds;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---