Gridview Linkbutton Postback Problem

Posted: Monday, April 8, 2013 in .NET, asp.net

Some of the Devs in my team had a problem with linkbuttons inside a Gridview template field.

When they clicked on the linkbutton it didn’t postback.

I thought it’s an application wide issue, but in some pages it worked.

Then it came into my mind the issue is coz of the validation controls in some of the page.

When use clicks on a gridview’s  linkbutton, if the page have validation controls, it will fire them,

BUT IT WON’T SHOW THE VALIDATION MESSAGE to the end user. So the user thinks it’s an another issue.

To fix this you can add CausesValidation=”false” attribute to the linkbutton.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s