I recently found that dropdownlist events are not shown in properties window. I was disappointed. I already hate asp.net designer in visual studio. its slow and full with ugly things like this. please help me. I need to generate events automatically not to write it by hand.
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to know full paths to DLL's from .csproj f
- How to store image outside of the website's ro
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
Can't speak for earlier versions of VS, but for 2013, after adding the element, Build the project. Sometimes I have to switch to Design view and back to Source view once on the page, but then the events appear:
Click the lightning bolt icon for the events. Double click
SelectedIndexChanged
and it creates this in the codebehind:And adds the event handler to the markup:
Click on the 'Split' view in MS Visual Studio - select a button in the 'Design' view and then look into property window now. You should be able to see Events now. Good luck.
It seems that the Properties Dropdown changes after viewing 'Split' or 'Design' view of the .aspx file at least once. In my case, I always left it in 'Source' mode and never saw the asp.net properties (and events) in Properties Dropdown.
The Design/Split/Soruce buttons are in the lower left of the text editor window pane.
I have found this too, only it happens on every control.
I found that if you are using "Source View", the events button is not shown in the properties window, but if you use design view and single click the control in design view (or "Both" view) then the events button is then shown in the properties window.
I suspect this is a bug in VS10? It's quite annoying as I don't like the Design view in VS, I always prefer Source view.
At the top of your code page there are two comboboxes. Choose your dropdownlist from the one on the left (It says "(General)" by default) and then choose your event from the one on the right one.
It will create the event for you and so you can just add your code.
I haven't found a good answer for this anywhere on the web so here it is:
After playing around I noticed that the Events options in Properties disappears after you have started editing the file. If you save or Ctrl+s then Visual Studio will reevaluate the page and realize its an actual ASP tag and give you the full properties with the events choices again.
You do not have to use Designer.