ASP.NET 4.5 and ASP.NET Core 1 Hosting BLOG

Tutorial and Articles about ASP.NET 4.0 and the latest ASP.NET 4.5 Hosting

ASP.NET Core 1.0 Hosting - ASPHostPortal.com :: Easy Steps to Create FileUpload Control With Drag Drop And Progress Bar in ASP.NET

clock July 1, 2016 19:50 by author Dan

This Example explains how to use AjaxFileUpload Control With Drag Drop And Progress Bar Functionality In Asp.Net 2.0 3.5 4.0 C# And VB.NET. May 2012 release of AjaxControlToolkit includes a new AjaxFileUpload Control which supports Multiple File Upload, Progress Bar and Drag And Drop functionality. These new features are supported by Google Chrome version 16+, Firefox 8+ , Safari 5+ and Internet explorer 10 + , IE9 or earlier does not support this feature. AjaxFileUpload Control Example with Drag Drop And Progress Bar.

To start with it, download and put latest AjaxControlToolkit.dll in Bin folder of application, Place ToolkitScriptManager and AjaxFileUpload on the page.

HTML SOURCE

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/>


<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"

                    OnUploadComplete="UploadComplete"

                    ThrobberID="loader"/>


<asp:Image ID="loader" runat="server"

           ImageUrl ="~/loading.gif" Style="display:None"/>


ThrobberID is used to display loading image instead of progress bar in unsupported browsers. Type of files uploaded can be restricted by using AllowedFileTypes property with comma separated list such as "zip,doc,pdf".

Write following code in OnUploadComplete event to save the file.

C#

protected void UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
 string path = Server.MapPath("~/Uploads/") + e.FileName;
 AjaxFileUpload1.SaveAs(path);
}


VB.NET

protected void UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
 {
string path = Server.MapPath("~/Uploads/") + e.FileName;
 AjaxFileUpload1.SaveAs(path);
}


Build and run the code.

Best ASP.NET Core 1.0 Hosting Recommendation

ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers ASP.NET hosting starts from $1/month only. They also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable ASP.NET Hosting, ASPHostPortal.com should be your best choice.



ASP.NET Hosting - ASPHostPortal.com :: 9 Mistakes to be Avoided by .NET Developer

clock June 6, 2016 23:50 by author Dan

Admit it! We all make mistakes. None of our codes starts working at strike one. We make typos, forget signing off or, as it happens with most of us, overlook the testing phase, especially when it comes to ASP.net development. To err is human. So, making mistakes is just another human phenomenon. What counts is how you tackle your errors and how you devise ways to avoid them in the ventures to come. Here's a compilation of some of the most common testing mistakes that developers often commit while catering to outsource .Net development needs. Let's take a look.

XSS Security Issues: The look and feel of your UI and of course, its maintenance lies in your hands. Ensure that all user-input fields are well-customized so that no JavaScript or HTML that a user enters can rummage your web page.

Universal Localization: As a usual norm, as you begin developing a new feature, you keep all the text in hard code as there are probabilities of certain changes during the course of development. As soon as the project team approves the feature, you localize the text. However, at times you tend to forget localizations of the entire text. You remember to hard code, but when it comes to localization you tend to sign off without doing the same. Probably this checklist reminds us to localize before we sign off the next time.

.Net Behaves Well with IE 6 and 7 and Firefox: Test leads often report of cross-browser compatibility issues that crop up from time to time. Most of these issues usually encompass small twigs like usual IE 6 issues or minor problems relating to positioning of elements. We are dedicatedly focusing on IE version 6 and 7 and Mozilla Firefox for two reasons. Firstly, if your web page works well in these three browsers, it will function well on Opera and Safari as well. Secondly, over 98% of the visitors access your site through these browsers.

Reuse Code as and when required: This law is applicable across all programming platforms and ASP.Net is no exception. Separate server and user-control elements enable specialization of code so that it can be used at other places as well.

Commenting on the Code: There are no two-ways to this. Always document your code well and comment upon the right places, so that it is easier for other developers to pick up from where you left.

Extended Text doesn't Mean Broken Design: As a matter of fact, names usually don't extend beyond 50 characters, but what if some user inputs a name containing 300 or even more characters. Obviously, in that case the UI will be disrupted. In this case you have two options- either codes your interface to accept long text inputs or put a limit on the length of text users can input.

Write Units When Possible: Unit testing for your website can be a tedious job especially if you are not using ASP.Net MVC framework for the same. However, pulling the code-behind logic into different components that can be placed in the library can enable you to test the units. Instead of dealing with HttpHandlers using .ashx files, placing them in separate libraries is a good option.

Peer Verification before Testing: Before signing off any newly added feature and sending it across to the test team, you usually pass it through peer verification. As the name suggests, in peer verification, one of your colleagues tests the application feature you have just developed and tries to find flaws in it. This allows you to identify errors easily and also simplifies the process for the testing team. When schedules are really tight, we often forget to ask for peer verification and it definitely shows at the end.

Expected functioning of Enter-key: When you are using webforms in ASP.Net, the enter-key often starts functioning weirdly. In this case, you can either set default buttons on the Panel webcontrol or from code-behind.

Best ASP.NET Hosting Recommendation

ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers ASP.NET hosting starts from $1/month only. They also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable ASP.NET Hosting, ASPHostPortal.com should be your best choice.



ASP.NET Hosting Tips - ASPHostPortal :: Simple Steps to Enable SSL in Visual Studio

clock January 15, 2016 20:14 by author Jervis

Hi… Happy New Year for you all. It’s long holiday and this is time to write new tips to open this year. This is only simple tutorial how to setup SSL for your ASP.NET project in Visual Studio.

You have your own ASP.NET project now and you want to run it on SSL. So, how to make it works?

The first step is easy. You just select the MVC/Web API project name in the solution and locate the property called “SSL Enabled” in properties window:

The same properties window will also show the HTTPS url for the application. In the above example it’shttps://localhost:44300/. Copy that URL and go to the project properties window. Locate the Web tab and override the Project Url property with the https address:

Start the application. You’ll likely get a message in the browser saying that the localhost address is not trusted, you can continue to the website at your own risk as you can see on figure below:

The problem is that the certificate that was installed automatically for you by Visual Studio is not trusted. You can locate the certificate in the Personal folder of the computer-level certificates in the certificates snap-in:

If you double-click the certificate you’ll see that it’s not trusted:

The message also provides the solution: the certificate must be imported into the trusted root certification authorities folder. You’ll see that as a folder in the same snap-in just below “Personal”. So how can we do that?

Right-click the certificate, then select All Tasks, Export… from the context menu. Click Next on the certificate export wizard. Leave the “Do not export the private key” option untouched, click Next. Accept the default on the next screen, i.e. “DER encoded binary X.509” should stay selected, then click Next. Then you’ll need to provide a name and a location for the exported file. Call it “localhost” and save it in a location where you can easily find it. Click Next and the Finish. There should be a popup message saying that the export was successful.

Next right-click the folder called Trusted Root Certification Authorities and select All Tasks, Import… from the context menu. Leave the “Local Machine” option untouched in the certificate import wizard, click Next. Browse to the certificate you saved just before. Click Next and accept all the default values along the way until you reach the end of the wizard. There should be a message saying that the import was successful.

If you now go back to the Personal store and double-click the localhost certificate then you should see that it’s trusted:

 

OK, let’s start the .NET web project again, the opening page should open without any warning. If you still see the same issue then test it a brand new browser session, e.g. here in IE:

It’s easy, right?



Cheap ASP.NET 4.5 Hosting

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link


 

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Tag cloud

Sign in