Use Ajax for the first time

Source: Internet
Author: User

OnlineAjaxThe conversation went viral. Recently, I went to see the project and wrote an article about it.PopThe prompt box is small.Program

The running result is as follows:

File description

Popwin. JS: The JS file in the pop-up prompt box does not need to be changed (this is public)

Ajax. dll: This is an Ajax component.

Source code
The most unfortunate thing about Ajax is that you cannot bind a DataGrid Server Control.
This is the only way to write data in a DataGrid.

[Ajax. ajaxmethod ()]
Public String getajaxtable ()
{
Try
{
Datatable dt = new datatable ();
Salesmanagerquery m_salesmanagerquery = new salesmanagerquery ();
Dt = m_salesmanagerquery.getsales ();
// Datagrid1.datasource = DT;
// Datagrid1.databind ();

// DataGrid DG = new DataGrid ();
DG. datasource = DT;
DG. databind ();
DG = maid;
maid = false;
system. text. stringbuilder strb = new system. text. stringbuilder ();
system. io. stringwriter Sw = new system. io. stringwriter (strb);
system. web. UI. htmltextwriter HTW = new htmltextwriter (SW);
DG. rendercontrol (HTW);
string S = strb. tostring ();
return s;
}< br> catch (exception ex)
{< br> throw ex;
}< BR >}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.