2

I want to display a particular div on the click of a button
My asp code is as follows

<asp:Button ID="Button1" class="btn" runat="server" OnClick="Submit" />

<div runat="server" id="signup" Visible="false">Some Content </div>

Now in the CodeBehind i have written the following code

protected void Submit(object sender, EventArgs e)
    {
        Button1.Visible = false;
        signup.Visible = true;
    }

But every time i get the error as

the name signup does't exist in the current context

i am not able to figure out the problem in the code..

2 Answers 2

4

You probably have wrong html for the div, you can also use style="visible:none" instead of Visible="false"

Change

visible:"false" 

To

Visible="false"
Sign up to request clarification or add additional context in comments.

1 Comment

I presume you mean style="display:none" or style="visibility:hidden".
0

This has to be done through JavaScript, I believe in the onClientClick attribute of the button. I'm currently searching for the code to jog my own

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.