views:

81

answers:

1

I created a form in a popup div, that contain an UpdatePanel with ImageButtons in it.

Initially, I used LinkButtons to test but I wanted ImageButtons. The thing is, it works well with LinkButtons and not with ImageButtons (absolutely nothing happens).

Checking the source, I see that the javascript call is a little different :
LinkButton :

<a href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions(&quot;ctl00$cphC$ctrlAdr$AdrMapo$lbAdresseSaisie&quot;,
&quot;&quot;, true, &quot;&quot;,
&quot;&quot;, false, true))"
id="ctl00_cphC_ctrlAdr_AdrMapo_lbAdresseSaisie">test</a>

ImageButton :

<input align="absmiddle" type="image" style="border-width:0px;"
onclick="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions(&quot;ctl00$cphC$ctrlAdr$AdrMapo$rpAdressesProposees$ctl00$ibAdresseProposee&quot;,
&quot;&quot;, true, &quot;&quot;,
&quot;&quot;, false, false))"
...>

After checking the doc, I see that the last parameter of WebForm_PostBackOptions is called clientSubmit and if it is set to true a submit is performed. For the ImageButton this value is set to false and if I change it to true manually with Firebug, it works as expected. But I can't find anywhere a way to change that parameter when the control is drawn. And that's quite annoying.

If I set ImageButton.CausesValidation, there is no javascript generated and nothing happen when I click on the button. The UpdatePanel is declared like this :

<asp:UpdatePanel ID="upAdressesProposees" ChildrenAsTriggers="true"
UpdateMode="Conditional" runat="server" Visible="true">

And to be sure I declared a trigger for the ImageButton. I use UpdateMode="conditional" because it needs to be updatable programmingly from outside of the UpdatePanel events.

The LinkButton submits correctly in exactly the same situation so I don't what I did wrong here...

A: 

Is there any client side validation being performed that is blocking the postback? Does it do a postback if you remove the UpdatePanel from the page? I would test that so you determine if it is a problem with the UpdatePanel + ImageButton or just the Imagebutton.

Dismissile
It's not the Validation : if I change manually the javascript's last parameter, it's still validating but submits after.And with CausesValidation = false it doesn't work either. It's a UserControl inside another UserControl with several UpdatePanels in each level so I guess it has something to do with that... If I remove my own UpdatePanel it still doesn't work but I can't edit Parent controls...
Julien N