I am having difficulty showing a hidden DIV or ASP.net Panel on postback.
I submit a page that adds items to a database then sends an email. Those items work perfect. However, I want a message to show up saying that it was successful. My understanding from what I have read is that if you are using a Panel with visibility set to False that it will not be rendered, therefore you cannot set it back to visibile from the server side.
As the insert to the database takes place an ajax update panel does show. But for some reason the portion to show the "success" message will not trigger.
I know that I am rambling, but just frustrated.
Here is the portion that should show after the insert and email "Success Message":
(currently set for trying to change the style. Tried visibility:hidden/visible too)
<div id="SubmittedPanelWrapper" runat="server" style="display: block" >
The change has been submitted.<br /> You will receive an email once the change is complete.<br /> <br />
<asp:Button ID="SubmittedOK" runat="server" Text="OK" CssClass="submitButton" />
Associated CSS for the Success Message:
border:solid 1px #000;
The submit button (visibile set to true from code behind once certain criteria are met, works):
<asp:Button ID="SubmitButton" runat="server" Text="Submit Changes"
style="text-align: center" Visible="false"
Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubmitButton.Click
SqlDataSourceInsertClientUpdate.Insert() ' <- Works
SendIANotificationEmail() ' <- Works
' This is where I would set a trigger to show the "Success" Message
' I've tried SubmittedPanelWrapper.Style.Add("display", "block")
' I've tried this with a panel as well.
' I've tried PanelChangeSubmitted.visible = True ** The panel code is no longer in the aspx page. But this is how I tried to activate it when it was.
I have even setup a new asp button and tried to trigger off of it, thinking it had something to do with the timing of the postback. But it didn't work either.
Any help in the right direction would be appreciated.