[254] Create method via quick fix in ASPX has wrong visibility
I noticed this bug recently (I'm currently using build 254):
Repro steps:
1. Declare a repeater control on your aspx or ascx page
2. Declare an event handler in the code in front (e.g. OnItemDataBound="ItemDataBound")
3. If the method 'ItemDataBound' does not exist, Resharper hightlights it
in red and provides a quick fix to create the method
4. When you perform the quick fix, the method is created in the code behind
with "private" visibility.
Expected behavior: The method should have "protected" visibility. The page
will not compile if the method has private visibility.
This actually happens with all controls, not just Repeaters, I just used
that as an example. Let me know if you are already aware of the issue or
if you would like me to submit it to the tracker.
Thanks,
~Andy Alm
Please sign in to leave a comment.
Hello Andy,
Thank you for your feedback. This problem is fixed in build 256, which will
appear shortly.
Thanks,
Andrey Simanovsky
Great! Thanks for the quick turnaround!
>> I noticed this bug recently (I'm currently using build 254):
>>
>> Repro steps:
>> 1. Declare a repeater control on your aspx or ascx page
>> 2. Declare an event handler in the code in front (e.g.
>> OnItemDataBound="ItemDataBound")
>> 3. If the method 'ItemDataBound' does not exist, Resharper
>> hightlights
>> it
>> in red and provides a quick fix to create the method
>> 4. When you perform the quick fix, the method is created in the code
>> behind
>> with "private" visibility.
>> Expected behavior: The method should have "protected" visibility.
>> The
>> page will not compile if the method has private visibility.
>> This actually happens with all controls, not just Repeaters, I just
>> used that as an example. Let me know if you are already aware of the
>> issue or if you would like me to submit it to the tracker.
>>
>> Thanks,
>>
>> ~Andy Alm
>>
I verified that this is indeed fixed in 256, however, I have found another
problem that is somewhat related. The quick fix doesn't appear to work correctly
with Generic Event Handlers. I have a custom control that has an event of
type EventHandler. When I perform the quick fix in the
code in front to generate the event handler method, the method gets generated
with the Event Args of type 'TEventArgs'. The EventArgs should be CustomEventArgs.
Let me know if you would like me to file a bug in the tracker.
~Andy
>> Hello Andy,
>> Thank you for your feedback. This problem is fixed in build 256,
>> which
>> will
>> appear shortly.
>>> I noticed this bug recently (I'm currently using build 254):
>>>
>>> Repro steps:
>>> 1. Declare a repeater control on your aspx or ascx page
>>> 2. Declare an event handler in the code in front (e.g.
>>> OnItemDataBound="ItemDataBound")
>>> 3. If the method 'ItemDataBound' does not exist, Resharper
>>> hightlights
>>> it
>>> in red and provides a quick fix to create the method
>>> 4. When you perform the quick fix, the method is created in the code
>>> behind
>>> with "private" visibility.
>>> Expected behavior: The method should have "protected" visibility.
>>> The
>>> page will not compile if the method has private visibility.
>>> This actually happens with all controls, not just Repeaters, I just
>>> used that as an example. Let me know if you are already aware of
>>> the
>>> issue or if you would like me to submit it to the tracker.
>>> Thanks,
>>>
>>> ~Andy Alm
>>>
>> Thanks,
>> Andrey Simanovsky
Hello Andy,
surely we would like you to file it to our tracker as a bug report. Thanks
in advance.
Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
>> Great! Thanks for the quick turnaround!
>>
>>> Hello Andy,
>>> Thank you for your feedback. This problem is fixed in build 256,
>>> which
>>> will
>>> appear shortly.
>>>> I noticed this bug recently (I'm currently using build 254):
>>>>
>>>> Repro steps:
>>>> 1. Declare a repeater control on your aspx or ascx page
>>>> 2. Declare an event handler in the code in front (e.g.
>>>> OnItemDataBound="ItemDataBound")
>>>> 3. If the method 'ItemDataBound' does not exist, Resharper
>>>> hightlights
>>>> it
>>>> in red and provides a quick fix to create the method
>>>> 4. When you perform the quick fix, the method is created in the
>>>> code
>>>> behind
>>>> with "private" visibility.
>>>> Expected behavior: The method should have "protected" visibility.
>>>> The
>>>> page will not compile if the method has private visibility.
>>>> This actually happens with all controls, not just Repeaters, I just
>>>> used that as an example. Let me know if you are already aware of
>>>> the
>>>> issue or if you would like me to submit it to the tracker.
>>>> Thanks,
>>>> ~Andy Alm
>>>>
>>> Thanks,
>>> Andrey Simanovsky
Hello Dmitry,
A bug has been filed: #27703.
~Andy
>> I verified that this is indeed fixed in 256, however, I have found
>> another problem that is somewhat related. The quick fix doesn't
>> appear to work correctly with Generic Event Handlers. I have a
>> custom control that has an event of type
>> EventHandler Andrey Simanovsky