Button won't fire after show/hide div

D

dje

In the OnClick event on a radioButtonList, I run a javascript to
show/hide the appropriate div along with a submit button, which
displays as expected. The problem is the submit no longer works on the
button. If I quit using the divs, and do a postback on the radiobutton
selection, showing/hiding tables instead, the button is ok and
continues to work. I've tried a variety of controls instead of the
button in a variety of places but it seems I can not do any postback
after I display the div. I'd like to use Javascript for performance
reasons. Anyone know what's up with the javascript and my button?
 
G

Guest

Have you tried panels, I find them very helpful if I understand what you are
trying to accomplish.

Previous posting (search for 'panels'):

Subject: alternative to Panels for show/hiding parts of a page? 9/15/2004
2:32 PM PST

By: darrel In: microsoft.public.dotnet.framework.aspnet

Was this post helpful to you?


I really like using Panels in ASP.net to show hide parts of a page. The only
catch is that, by default, panels are rendered as DIVs. There are times when
I'd like the panels rendered as Spans...so that they can be used as inline
content.

I can set the display: inline style programatically, or I can create a new
CSS style for this panel and set the 'display: inline' style there, but I'm
wondering if there's a more direct workaround that I could place directly in
the asp:panel tags do it's not dependant on external styling.

-Darrel
 
D

dje

Thanks Chris. I rewrote the entire page (using the javascript and divs
on the click event for the radio button list) and it worked fine. It
seems like once you get a .net project under source control, it is
very fussy about having the page renamed.
-D
 
G

Guest

great! you might want to check out panel use to really take advantage of it
as a control. I found it helpful to "hide" it on page load via the code
behind and then control it based on user controls. Enjoy!

Protected WithEvents partnering As Panel

'hide convergance panel
partnering.Visible = False

on aspx page:
<asp:panel id="partnering" Runat="Server">
</asp:panel>
 
D

dje

To correct my earlier post:

The problem turned out to be the required field validators that were
in the divs. While these validators weren't visible, they were firing
and preventing the postback. Someone give me a gun!
-D
 
G

Guest

not sure what "give me a gun" means but panels won't fire validators either.
But to each their own. enjoy.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top