Question

I am calling asp.net button click event through jquery.

$('[id$=btnSaveAsp]').click();

I am sending html data into asp.net hidden field. It is working fine with small amount of data but it is not firing with large amount of data. What should I do???

Was it helpful?

Solution 2

It is not the problem of click event. It is actually problem of http runtime in asp.net web config file Please add this tags in web.config to resolve this issue.

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="40960" requestValidationMode="2.0"/>
        <pages validateRequest="false"></pages>
    </system.web>
</configuration>

OTHER TIPS

You have to change your code to

$('#'+'<%= aspBtn.ClientID %>').click();

As I see you select you dom element using jquery and it's id. In order to accomplish this you should use the # inside your selector. Also you haven't to use =id$ = inside you selector.

Generally, when you want to select an element using jquery and the id of the element, you have to follow the following pattern:

$('#id')

where id is the id of the element you want to select.

For further documentation on this, please look here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top