ASP.NET C# OnMouseOver Event to Make ListBox Appear and Disappear -


I have a webform that has a listbox and a button when the OnMosavor event is set to fire, the list box will appear; However on the page load, the listbox should not be visible. I have the following code (please trick background color changes):

  button2 Specialty. Add ("On Mouse Out", "this.style.backgroundColor = 'Blue', ListBox3.style.display = 'None'"); Button 2 a quality. Add ("OnMosOver", "This.style.background color = 'red', list box 3.style.desplay = 'block'");  

This code works when the listbox.visible is set to true. Unfortunately, when the page loads, the listbox always appears, which is what I want to do. When I set the list box for visible = false, the above code does not work. I have messed around with postback and if the statement, like (button = red), display = block; However, it is of no avail. I am stuck at this point. Does anyone know what I should do to work above code? I'm new to ASP.NET, so I do not know whether I have to do something with html or not, besides an interesting thing, the background color of the code works without any consistency.

I really appreciate the help of everyone.

When you set listbox visible = "false" in server-side code, list box The HTML is not provided and the client is sent. Therefore, you need to make sure that the ListBox is provided, but the page is not shown on load, either

  • the initial CSS style list box is not visible

or

  • Using javascript on the client, it is not visible when the domain is loading.

This is also a look at


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -