且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用javascript将sqlserver数据绑定到asp.net控件

更新时间:2022-04-22 02:50:20

绑定sqlserver数据到asp.net控件?您是否尝试过使用AJAX在后台调用另一个页面?

我可能会用这种方式解决.

假设您要第1页上的数据.您可以通过AJAX在后台调用page2,而所有page2要做的就是连接到数据库并获取所需的数据,并将其返回给page1的调用方.完成后,您现在可以通过控件的ID将数据分配给控件.

只需仔细检查浏览器中的源即可.当页面已经加载到浏览器中时,asp.net控件ID可能会不同.

我不确定,因为您对要做什么做了简短的描述,但我希望这对您有所帮助. :)
have you tried using AJAX to call another page in background?

i''ll probably solve it this way.

let''s say you want those data on page1. you can call page2 in background through AJAX and all page2 has to do is connect to the database and fetch the data you need and return it to the caller at page1. Once done you can now assign the data to the controls through their ids.

just double check the source in the browser. asp.net control ids may not be the same when the page is already loaded in the browser.

i can''t be really sure because you have quite a short description of what you want to do but i hope this helps a bit. :)