AJAX UpdatePanel on postback.

S

Shawn

I cannot find an AJAX feed here, so I am posting in here...

I want to set the visibility of my updatePanel to true upon postback from an
ASP.NET button. It works fine, but the panel flashes in it's starting
position before moving to it's final (correct) one. How can I get around
that?

Here is the button code.

Protected Sub btnAdminCommit_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles btnAdminCommit.Click
Try
cnn.Open()

SubmitApplications()
SubmitPageAccess()
SubmitBusStructAccess()

cnn.Close()

upSecurity.Visible = False

lblConfirm.Text = "Updates Complete"
upConfirm.Visible = True
upConfirm.Update()
mpopConfirm.Show()
Catch ex As Exception
trUpdateAdminAccess1.Rollback()
trUpdateAdminAccess2.Rollback()
trUpdateAdminAccess3.Rollback()
cnn.Close()

upSecurity.Visible = False
upSecurity.Update()
mdlPopUp.Hide()

lblConfirm.Text = "There was an error submitting the change: " &
ex.Message
upConfirm.Visible = True
upConfirm.Update()
mpopConfirm.Show()
End Try
End Sub

The "up..." controls are my UpdatePanels.

Here is the code for the upConfirm Panel.

<asp:UpdatePanel ID="upConfirm" runat="server" UpdateMode="Conditional"

Visible="False">

<ContentTemplate>

<asp:panel ID="pnlConfirm" runat="server" BackColor="White"
BorderColor="Gray"

BorderStyle="Ridge" BorderWidth="3px" Width="300px" ScrollBars="Auto">

<br />

<asp:Label ID="lblConfirm" runat="server" Text="Label"></asp:Label>

<ajaxToolkit:ModalPopupExtender ID="mpopConfirm" runat="server"

BackgroundCssClass="AJAX_Background" PopupControlID="pnlConfirm"

TargetControlID="btnHiddenConfirm" CancelControlID="btnConfirmOK"

oncancelscript="hideConfirm()">

</ajaxToolkit:ModalPopupExtender>

<br />

<br />

<asp:Button ID="btnConfirmOK" runat="server" Text="Close"
BackColor="SteelBlue"

ForeColor="White" />

<asp:Button ID="btnHiddenConfirm" runat="server" Text="Button"
style="display:none;"/>

<br />

<br />

</asp:panel>

</ContentTemplate>

</asp:UpdatePanel>
 
I

iduditz

in the <asp:panel id="pnlConfirm" .... just set an attribute in its css style
to display: none
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top