none
Does not open the backend Event Listener Code on double clicking the button instead opens some protected sub button_click...end sub code RRS feed

  • Question

  • When i double click on the asp control button instead of opening the code in the .cs file it opens and adds the code in the same .aspx file like

    <script runat="server">

        Protected Sub Next_Click(sender As Object, e As EventArgs)

        End Sub

        Protected Sub Submit_Click(sender As Object, e As EventArgs)

        End Sub

       </script>

    .I want to do event handling in .cs file..help

    I have used asp control button.



    Saturday, October 12, 2019 1:55 PM

All replies

  • Hi SanjanaJoshi,

    Thank you for posting here.

    According to your description, I have some questions to confirm with you.

    Could you please tell me what’s your version about your asp.net web form application? ASP.NET 2.0 or something else.

    Do you create a asp.net web sites or web application? It will help us to make a test.

    We are waiting for your update.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, October 14, 2019 8:11 AM
    Moderator
  • <asp:Button ID="MyButton" OnClick="MyButton_Click" runat="server" Text="Button" />

    You place the control's event method in the aspx.cs codebehind file.

    protected void MyButton_Click(object sender, EventArgs e) {

    // place code in the event var help = "help";

    }


    BTW, ASP.NET issues can be discussed at the ASP.NET forums.

    http://forums.asp.net/

    Monday, October 14, 2019 10:13 AM