Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the mini system of article publishing and management by ASP.NET

Shulou Source: shulou.com Published: 2022-06-03 06:19:44 10月02日 Update

This article mainly introduces ASP.NET how to achieve the article release management system, the article is very detailed, has a certain reference value, interested friends must read it!

Master page: SiteFont.Master

The code is as follows:

/ / $(function () {

/ / $("# nav li") .Mouseenter (function () {

/ / $(this) .addClass ("active") .siblings () .removeClass ("active")

/ /})

/ /})

My home page |

About us |

Resource download |

My collection |

Article dynamic |

About us.

Intellectual collaboration copyright 2013-2013 Yue A

Master page CSS file: main.css

The copy code is as follows:

Body {

}

.clear

{

Clear:both;}

# mainBox

{

Width:950px

Margin-left:auto

Margin-right:auto;}

# nav

{

List-style-type:none

Background-color:inherit

}

# nav LI

{

Float:left

Margin-right:20px

Font-size:large

}

# nav .active

{

Background-color:Red

}

Main page: News_admin.aspx

The copy code is as follows:

Publish an article

There are no articles for the time being

Modify

STitle

SbuildDate

IType

SUser

Article list page: News_list.aspx

The copy code is as follows:

There are no articles for the time being

Add / modify articles page: News_add.aspx

The copy code is as follows:

Attachment upload background code: Pic_load.aspx.cs

The copy code is as follows:

Using System

Using System.Collections.Generic

Using System.Linq

Using System.Web

Using System.Web.UI

Using System.Web.UI.WebControls

Using System.IO

Namespace Collaborative Enterprise Management system. Admin

{

Public partial class Pic_load: System.Web.UI.Page

{

Protected void Page_Load (object sender, EventArgs e)

{

}

Protected void Button1_Click (object sender, EventArgs e)

{

FileUpload fileload = (FileUpload) form1.FindControl ("FileUpload1")

If (fileload.HasFile) {

/ / verify the file type

String ext = Path.GetExtension (fileload.FileName). ToLower ()

Response.Write (ext)

If (ext = = ".jpg" | | ext = = ".jpeg" | | ext = = ".gif" | | ext = = ".png")

{

Response.Write ("sucess")

/ / full path. Root directory

Fileload.SaveAs (Server.MapPath ("~ / image/" + fileload.FileName))

}

Else

{

ClientScript.RegisterStartupScript (GetType (), "alert", "alert ('only jpg/jpeg/gif/png files are allowed to upload');", true)

Return

}

}

}

}

}

The above is all the contents of the article "how to implement the mini system of article release and management in ASP.NET". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Code article system management enterprise enterprise management page file parameter background data release management content dynamic news article details attachment home page value Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi macOS MariaDB Docker