Generating event on .cs page by double click on the design view of .aspx page
I am developing a web application in asp.net and c#, now in a particular aspx page whenever I doubleClick(design view) on a button or on a drop down list, instead of going to
public void btn_click
event or DropDown_SelectedIndexChanged
event, the cursor points to protected void P开发者_Go百科age_Load only. Strange!! any remedy?
Not a fix for your VS misbehaving, if it is doing so. But this will help you wire up your events and perhaps notice anomalous event assignments:
Select the control in question, right-click>Properties, switch to the 'events' tab (lightning bolt) and either enter the name of a method or simply double click the empty space to generate an event handler in your codebehind.
This is also where you will see if Page_Load is already, for whatever reason, assigned to the event you are having trouble with.
HTH
May be both your btn_click event and DropDown_SelectedIndexChanged event delegates have Page_Load as the method. Check your events tab for button and dropdown.
this happens to me when I have my project running in debug mode and forget to stop it before editing my code. Long shot, but sometimes the obvious things are the things we overlook :)
精彩评论