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
The solution is very easy.
It is just simple,it just that you can not see the events in the source view, you have to just switch to the design view to see the events and double click them to generate events. and again come to design view
When using VS2012 this can be done without actually going into Design view. I know the question is specifically for VS2010, but I can't test this answer myself.
In
source
view simply start adding the appropriate attribute, for exampleOnServerValidate
on aCustomValidator
. As soon as you type the=
sign the very first item in the list is<Create new event>
, which has the same function as double clicking the control.If you want to create
OnSelectedIndexChanged
Event you can double click yourDropDownList
in design view.if not try writing this :
and then press tab 2 times. so it will create event handler for you. then you need to copy your handler name and paste it in your control markup.