ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 307,138 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,808 people online right now. Registration is fast and FREE... Join Now!




Want to click and have a hidden area get displayed?

 

Want to click and have a hidden area get displayed?

cdietschrun

24 Jun, 2009 - 05:51 AM
Post #1

New D.I.C Head
*

Joined: 23 Jun, 2009
Posts: 24

So I am new to this stuff and I have a page with links right now that open up a new page. I want to make it so that when you click the link, an area that wasn't previously displayed on the bottom of the page. They only lead I have is in the .aspx page

CODE
<div id="checklistarea" runat="server"></div>


I am using javascript and AJAX through a ScriptManager if that matters.

Could anyone give me an idea?

EDIT:

I have this much:
At the end of my .aspx is the code above, then my VB page calls this javascript function:

CODE

function OpenChecklistForm(id,uut){
  var divchklist=document.getElementsByTagName('checklistarea');
  PageMethods.DisplayChecklist(id, uut, CallbackDiv, CallbackAlert, 'divchecklist')


Then the pagemethod is simply:
CODE

Public Shared Function DisplayChecklist(ByVal id As String, ByVal uutnumber As String) As String

        Dim ret As String = ""

        'Checklist area
        ret &= "<br /><fieldset>"
        ret &= "<legend>Checklist area</legend>"
        ret &= "</fieldset>"

        Return ret
    End Function


And the callback on success function (CallbackDiv) is:

CODE

function CallbackDiv(ret,destctl){
    var d=document.getElementById(destctl);
    if (d){d.innerHTML=ret;}
}


On clicking the link, nothing happens. There are no errors in Firefox addon's web dev kit's error panel, and in IE, there is no errors or warnings after the click.

EDIT 2: Nevermind, got it!

This post has been edited by cdietschrun: 24 Jun, 2009 - 06:16 AM

User is offlineProfile CardPM
+Quote Post


eclipsed4utoo

RE: Want To Click And Have A Hidden Area Get Displayed?

24 Jun, 2009 - 05:18 PM
Post #2

Not Your Ordinary Programmer
Group Icon

Joined: 21 Mar, 2008
Posts: 1,846



Thanked: 205 times
Dream Kudos: 500
Expert In: .NET

My Contributions
if you are simply wanting to make a control that is hidden to show up with a button click, why not just create a Click event handler for the button, then set the control's visible property to true? As long as the control has the "runat" and "id" attributes, it is available in the code behind. This will work for any control, HTML, ASP.Net, or AJAX. As long as it has the "runat" and "id" attributes set, you can use them in the code behind.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:21PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month