.NET Daily

__doPostBack not trigger the Button Click event

Introduction

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.


LATEST POSTS

My View on the Life cycle of a Fixed Cost Web Project 01st July, 2018

How to Deliver Accurate Project Status Reports 21st April, 2018

Common .NET Exceptions

__doPostBack not trigger the Button Click event

Posted on .

Problem 1: You call __doPostBack javascript function to trigger a click event of a button but the event is not executed although Page_Load event is triggered;

Resoulution of Problem 1:

You probably used something like this:

__doPostBack('<%=btnButton.ClientID %>', "");

Instead, you should use something like this:

__doPostBack('<%=btnButton.UniqueID %>', "");

So if you noticed, you need to send the UniqueID of the button, not the ClientID.

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.

There are no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

View Comments (0) ...
Navigation