Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Hide panel when Send clickedHide panel when Send clicked
Previous
 
Next
New Post
5/17/2007 10:51 AM
 

I am sending data to a web service. Once the user clicks Send I would like to hide the data entry form and show some form of progress indication while waiting for a response.

Using Ajax I can display an animated gif. How do I hide the panel?

something like a link which calls a javascript function which hides the panel and then fires a function which calls the ws ...?

Alternatively do I have to go to the server to hide the panel; call the ws and then write another response to the client.

Any suggestions welcome.

Declan


 
New Post
5/17/2007 2:16 PM
 

You could use javascript to hide the panel, or a div containing the panel.  Add an OnClientClick method that calls the javascript to do the hide, then your postback event can work as expected with AJAX.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
5/18/2007 8:02 AM
 
OK, I need a little more help here, please. I haven't a clue about javascript

What is wrong with my code below? linkSubmit_Click changes the label text but the panel is not hidden.

<head runat="server">
<
title>Untitled Page</title>
<
script language="javascript" type="text/javascript">

    function HidePanel()
    {
        var pnl = document.getElementsByName('pnl1');
        pnl.visible = false;
    }
</script>
</
head>
<
body>
<form runat="server" action="Default.aspx" >
    <
asp:Panel ID="pnl1" runat="server" >
        <
asp:label ID="lbl1" runat="server" Text="Test label"></asp:label>
    </
asp:Panel>
    <
br />
    <
asp:LinkButton ID="lnkSubmit" runat="server" Text="Submit"></asp:LinkButton>
</
form>
</
body>
</
html>
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
     Me.lnkSubmit.OnClientClick = "HidePanel;"
 
End Sub
 
Protected Sub lnkSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkSubmit.Click
 
    lbl1.Text = "Submit Clicked"
 
End Sub
 

 
New Post
5/18/2007 8:36 AM
 

In the sample below the check box will show hide the panel but the submit button will not.

<script language="javascript">
 
function ShowHide(target)
 
{
    obj=(document.all) ? document.all[target] : document.getElementById(target);
    obj.style.display=(obj.style.display=='none') ? 'inline' : 'none';
}
</script>
 
</head>
<body>
    <form id="Form1" runat="server">
       <p>
            <input type="checkbox" onClick=" ShowHide('Panel1');" /> Show/hide Panel.
        </p>
        <p>
        <asp:LinkButton ID="lnkSubmit" runat="server" Text="Submit" onClientClick=" ShowHide('Panel1');"></asp:LinkButton>
        </p>
        <p>
            <asp:Panel id="Panel1" runat="server">This is some dummy text in a panel...</asp:Panel>
        </p>
    </form>

 
New Post
5/18/2007 9:12 AM
 

The difficulty is in the fact that ASP.NET controls such as Panel implement the INamingContainer interface, which means that things are done to the id that ensure it is unique across the page, so your id might be significantly longer than what you expect.

Since you are working with DNN, you can do some code on the backend to determine the id of the control, but I would have to look at exactly what I did in the past (I'm not at home right now...)

Otherwise, you could put a standard HTML div around the item and then the id of that div wouldn't change.

If you want to see what I am talking about when viewing your page, viw the HTML source and have a look at the id.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Hide panel when Send clickedHide panel when Send clicked


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out