How to run C# directly in ASPX page

<%@ Page Language=”C#” %>
<%@ Import Namespace=”Amazon.S3″%>
<%@ Import Namespace=”Amazon.S3.Model”%>

<script runat=”server”>


protected void Page_Load(object sender, EventArgs e)
{

string bucketName = “XXXXXX”;


AmazonS3Client s3Client = AmazonS3Helper.GetAmazonS3Client();

string folderPath = “documents/XXXX/”;

PutObjectRequest request = new PutObjectRequest()
{
BucketName = bucketName,
Key = folderPath // <– in S3 key represents a path
};

PutObjectResponse response = s3Client.PutObject(request);

}

</script>

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head runat=”server”>
<title></title>
</head>
<body>

</body>
</html>

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...