Move WebForms notes to single file

This commit is contained in:
Marcello Lamonaca 2021-04-04 10:40:33 +02:00
parent 6971933509
commit 8fc0fc905c
2 changed files with 31 additions and 30 deletions
.NET/ASP.NET

View file

@ -1,4 +1,6 @@
# Page.aspx
# WebForms
## `Page.aspx`
The fist loaded page is `Default.aspx` and its undelying code.
@ -22,8 +24,6 @@ The fist loaded page is `Default.aspx` and its undelying code.
</html>
```
## ASP.NET Directives
### Page Directive
```cs
@ -33,7 +33,7 @@ The fist loaded page is `Default.aspx` and its undelying code.
Inherits="EmptyWebForm.Default" %>
```
## Web Controls
### Web Controls
```xml
<asp:Control ID="" runat="server" ...></asp:Control>
@ -56,3 +56,30 @@ The fist loaded page is `Default.aspx` and its undelying code.
<!-- SqlSataSource; connection string specified in Web.config -->
<asp:SqlDataSource ID="sds_" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SQL Query"></asp:SqlDataSource>
```
## `Page.aspx.cs`
```cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Project
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Control_Event(object sender, EventAtgs e)
{
// actions on event trigger
}
}
}
```

View file

@ -1,26 +0,0 @@
# Page.aspx.cs
```cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Project
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Control_Event(object sender, EventAtgs e)
{
// actions on event trigger
}
}
}
```