I’m working on an application which shows a list of contacts from a db (firstname, lastname and so on). It is possible to add a new contact, and I’m using InsertItemTemplate with ListView to accomplish that.
The thing is that I don’t want the text boxes for adding a new contact to be visible by default. Instead I have added a button, and when clicked the text boxes shall be visible. The problem is that I can’t get this to work.
I’ve tried with InserItemPosition=”None” by default, and when clicking the button it gets changed to “First”. This works and the text boxes shows up. The problem is that when I add a new contact nothing happens (ie. the page reloads and no contact is added).
Adding a new contact works fine if I have InsertItemPosition=”First” by default.
Why doesn’t it work and is there another way to accomplish what I want?
You could do it really simply with CSS:
Wrap the fields for the new contact in a div with
display:none;set, then toggle the display to block with your button: