Do you see any thing wrong with the following code?
I want to create a Button1_Click event for Button1 but the property page is grayed out in design mode. I manually created the event but clicking on button won't execute this code. I am trying to refresh a GridView on parent page from AJAX Popup is closed.
According to your description, I noticed that you put the button inside the panel, but you set the property display of button to none. So I think this make it grayed out.
Also I think about how to add click event to button, please check the following sample code:
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
59 Points
349 Posts
Another Strange Behavior in VS Design Mode
Jul 27, 2017 09:58 PM|NJ2|LINK
Do you see any thing wrong with the following code?
I want to create a Button1_Click event for Button1 but the property page is grayed out in design mode. I manually created the event but clicking on button won't execute this code. I am trying to refresh a GridView on parent page from AJAX Popup is closed.
protected void Button1_Click(object sender, EventArgs e)
{
ProcessMyRequest();
}
All-Star
37121 Points
14987 Posts
Re: Another Strange Behavior in VS Design Mode
Jul 27, 2017 11:00 PM|mgebhard|LINK
Yeah, you set the style to display: none. Use the property window from the HTML code view to generated the click handler.
All-Star
50651 Points
9839 Posts
Re: Another Strange Behavior in VS Design Mode
Jul 27, 2017 11:31 PM|A2H|LINK
Also set the button's UseSubmitBehavior property to false
Aje
My Blog | Dotnet Funda
Contributor
6680 Points
2715 Posts
Re: Another Strange Behavior in VS Design Mode
Jul 28, 2017 04:37 AM|Eric Du|LINK
Hi NJ2,
According to your description, I noticed that you put the button inside the panel, but you set the property display of button to none. So I think this make it grayed out.
Also I think about how to add click event to button, please check the following sample code:
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.