This is a migrated thread and some comments may be shown as answers.

[Solved] form needs two clicks in RadAjaxPanel

4 Answers 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 12 Mar 2009, 04:02 PM
Hi

I am having an odd problem - what am I doing wrong here? It takes two clicks to get it
to do its stuff (at this point it just sets the panel invisible)
the RadAjaxPanel is used with a Textbpx and a button
<telerik:RadAjaxPanel ID="RadAjaxPanelDownload" runat="server" Visible="true" defaultButton="ButtonDownload" Height="50px" Width="164px">  
<telerik:RadTextBox ID="RadTextBoxEmailDownload" runat="server" 
Width="154px" MaxLength="50" style="font-size:10px !important; padding:2px !important;">  
</telerik:RadTextBox><br /> 
<asp:Button ID="ButtonDownload" runat="server" Text="GO" CausesValidation="False"   
UseSubmitBehavior="False"/>  
</telerik:RadAjaxPanel> 
and the code behind
Protected Sub ButtonDownload_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles ButtonDownload.Click  
' read the email and save, email to customer requesting conf, alert  
RadAjaxPanelDownload.Visible = False 
End Sub 

 

When I click the button nothing happens. Click it again and the code runs, the panel goes invisible.
It's as if the first click is need to get focus.
Am I missing something?

Thanks

Clive

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 16 Mar 2009, 08:03 AM
Hello Clive Hoggar,

I am afraid that it is not suggested to change the visibility of RadAjaxPanel, e.g. make it invisible.
I am sending you a small runnable application with the implementation request by you.
Give it a try and see if it works for you.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Clive Hoggar
Top achievements
Rank 1
answered on 16 Mar 2009, 06:42 PM
Hi
Thanks for this.
Meantime - FYI - I took the button out of the panel and set the visibility of the button to false
separately  in the code behind, along with setting the RadPanel vsisibility  and that works.
 I would have thought that setting the visibility
property was a rather fundamental aspect of the use of panels in submitting forms?
Thanks
Clive
0
Pavlina
Telerik team
answered on 19 Mar 2009, 12:57 PM
Hello Clive,

For more information about Show/Hide Web Controls, please look at the following live demo:
Show/Hide Web Controls
I hope this helps.

Greetings,
Pavlina
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Clive Hoggar
Top achievements
Rank 1
answered on 27 Mar 2009, 05:55 PM
Hi
In case it helps anyone, the final solution was like this:

Insert a main RadAjaxPanelMain on the page

INSIDE this panel insert
- another panel -  RadAjaxPanelForm - containing the form controls
- a button
- a label containing a success message
- a RadAjaxLoadingPanel

Set the RadAjaxPanelMain loading panel property to the ID of the RadAjaxLoadingPanel

You can then do the business in the button click event in the code behind,
and set the RadAjaxPanelForm Visible property to false, the label property 
to visible, and it works with one click.  The loading panel also does its stuff.

Regards
Clive
Tags
General Discussions
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Clive Hoggar
Top achievements
Rank 1
Share this question
or