Ajaxpro indicates a resource download error, which is used by ajaxpro.

Source: Internet
Author: User

I have been modifying the project recently. I saw that the previous developers used ajaxpro and used it myself,

1. Web. cofig add nodes

<System. Web>
<Httphandlers>
<Add verb = "post, get" Path = "ajaxpro/*. ashx" type = "ajaxpro. ajaxhandlerfactory, ajaxpro"/>

 

2Add references to the CS File

Using ajaxpro;

 

3. CS file loading event

Protected void page_load (Object sender, eventargs E)
{

Utility. registertypeforajax (typeof (Class Name ));

 

4. Add [ajaxpro. ajaxmethod] To the Cs method.

[Ajaxpro. ajaxmethod]
Public String getname (string selectvalue)
{

// Note: 1. return values are required; 2. Controls are not available in the method body; 3. It is best to have input parameters. Sometimes, the error "download of specified resource error" is reported"

// Error
Return selectvalue;
}

 

5. Front-end JS use

<SCRIPT type = "text/JavaScript" Language = "JavaScript">
Function Tan ()
{
VaR A = Class Name. getname ("1111"). value;
Alert ();
}

</SCRIPT>

6. Controls

<Input type = "button" id = "btn1" value = "Click here" onclick = "Return Tan ()"/>

 

 

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.