All About ASP.NET and ASP.NET Core 2 Hosting BLOG

Tutorial and Articles about ASP.NET and the latest ASP.NET Core

ASP.NET 4.5.2 Hosting with ASPHostPortal.com :: SEO Tips for Your ASP.NET Site

clock August 23, 2014 09:42 by author Kenny

Here are 7 tips on SEO for your ASP.NET website:

A Microsoft server-side Web technology. ASP.NET takes an object-oriented programming approach to Web page execution. Every element in an ASP.NET page is treated as an object and run on the server. An ASP.NET page gets compiled into an intermediate language by a .NET Common Language Runtime-compliant compiler.

Page Titles

Page titles between tags is one important thing that many fail to practice in SEO. When a search is made in Google, these titles show up as links in the result. So that explains its importance. The common mistake among website owners is giving the same title for all pages. Page titles drive traffic to your site, hence it is important to have a proper title to attract visitors. Adding titles is not as hard as you imagine. If you have a product catalog use your product name as title. You can also choose to give a different title that is related to your product.

Meaningful URL

URLs that are long with query parameters do not look neat and it is difficult for the visitor to remember. Instead use formatted URLs for your static pages. URL which has a meaning explains the content in your website. Although experts agree with using an URL that has query parameters, it is better to have a meaningful URL. Components like UrlRewritingNet can be used for this purpose. Mapping support in URL is offered by IIS7 which has plenty of features.

Structure of the Content

Content without a structure is not possible.  You will have titles, headings, sub headings, paragraphs and others. How would you emphasize some quotes or important points in your content? If you follow the below mentioned steps, the structure of your content will be semantically correct.

  • Divide long stories or parts using headings. Short paragraphs make more sense to the readers. Use tags to bring beauty to your content.
  • If you want to emphasize an important point or quote, place them between tags.

Visitors can create structured content if you use FCKEditor and the like. Integrating these to your website is not complex.

Clean the Source Code

Don’t panic, it is advisable to clean up the source code and minimize the number of codes. The following simple steps will assist you in cleaning the source code: You can use

  • External stylesheets and not inline CSS
    • js files instead of inline JavaScript
  • HTML comments is not encouraged
  • Avoid massive line breaking
  • Avoid using viewstate when not required

The relation between the content and the code (JavaScript, HTML, CSS) determines the ranking of your website. Smaller source codes help build a strong relation.

Crawlable Site

Do not use

  • Silver or flash light for menus or to highlight information
  • Menus based on JavaScript
  • Menus based on buttons
  • Intro-pages

Do use

  • Simple tags wherever possible
  • Sitemap
  • “Alt” for images
  • RSS

Test the Site

What happens to the requests that are sent when the site is slow? Sometimes requests are sent by robots and if they are unable to connect to your site continuously, they drop the site from their index. Enable your site to respond fast to requests even during peak hours. Moreover, visitors don’t like to visit slow sites. Use the various tools available and conduct the stress test for your site. Perform this and locate all the weak parts of the site. Fix them so that your site gets indexed. 

Test the AJAX site

Spiders can only run a few parts of your AJAX website because they don’t run JavaScripts. Spiders can only analyze the data and hence they remain invisible to robots. The AJAX sites do not get indexed which does not help in search engine optimization. To make the site spider friendly, try and keep away from initial content loading into the JavaScript. You can also follow this only for pages that you like to index.  Make it easy for robots so that they can navigate. Try this simple trick to see how your AJAX site will appear to the robots. Disable JavaScript from the browser and visit your AJAX site. You can view the pages which robots will index.



Cheap and Best BugNET Hosting :: How to Install BugNET with SQL Server 2008

clock July 23, 2014 09:29 by author Ben

BugNET is an open source bug tracking tool based on SQL written in ASP.NET language. It is a cross-platform application used to keep the codebase simple. BugNET supports many features such as email notifications, multiple databases and projects supports, easy navigation, excellent security etc. The main goals are to keep the codebase simple, well documented, easy to deploy and scalable.

Installing BugNET
There are three ways you can install BugNET. You can:

  • Install it using the Web Deployment Package.
  • Download the BugNET .zip file and install it as described in Manually Installing BugNET Using a zip file.
  • Download the BugNET source code and build BugNET from the command line or in Visual Studio.


Requirements

  • ASP.NET 4
  • A web server such as IIS Express 8, 7.5 or IIS 7.x.
  • Microsoft SQL Server 2008 Express or greater.


ASPHostPortal windows hosting is compatible with the BugNET. We offer BugNET based hosting plan from just $5/month (see our BugNET Hosting Plan).

And now we'll tell you about How to Install BugNET Using SQL Server 2008:

  1. Extract the contents of the install package to a folder on your computer.
  2. Create a directory in the c:\inetpub\wwwroot\ folder called bugnet (c:\inetpub\wwwroot\bugnet)
  3. Copy the contents of the BugNET folder in the install package to the c:\inetpub\wwwroot\bugnet\ folder
  4. Go to the properties of the c:\inetpub\wwwroot\bugnet\ folder, click on the Security tab, be sure to add the permissions for the appropriate user (WinXp/2000 uses the local ASPNET account, Win2003/Vista/2008/7 use the local Network Service account). Give this account modify permissions on (if necessary):
  5. Uploads - if using file system based uploads
  6. Create a virtual directory in IIS for the bugnet folder.
  7. Open up the the web server IIS Console, start-> run-> INETMGR
  8. Expand the websites node
  9. Expand the default websites node
  10. Right click on the BugNET folder under the default website, click on Convert to Application, if you don't have that option, choose properties and then add the application.
  11. Configure the database server.
  12. Load the SQL Server Management tool
  13. Expand the Server/Security node
  14. Create a blank SQL Database (e.g db name 'BugNet') on your sql server using a case insensitive collation.
  15. Configure the SQL User Security/Account to allow IIS and ASP.NET access to the database in SQL.


When the installation is complete, you may log in with the admin user account.
Username: admin
Password: password


Cheap and Best BugNET Hosting with ASPHostPortal.com
ASPHostPortal.com BugNET optimised hosting infrastructure features independent email, web, database, DNS and control panel servers and a lightning fast servers ensuring your site loads super quick! Reason why you should choose us to host your BugNET site:

Easy to Use Tools - ASPHostPortal.com use World Class Plesk Control Panel that help you with single-click BugNET installation.
Best Programming Support - ASPHostPortal.com hosting servers come ready with the latest PHP version. You can get access directly to your MySQL from our world class Plesk Control Panel.
Best Server Technology - The minimal specs of our servers includes Intel Xeon Dual Core Processor, RAID-10 protected hard disk space with minimum 8 GB RAM. You dont need to worry about the speed of your site.
Best and Friendly Support - Our customer support will help you 24 hours a day, 7 days a week and 365 days a year to assist you.
Uptime & Support Guarantees - We are so confident in our hosting services we will not only provide you with a 30 days money back guarantee, but also we give you a 99.9% uptime guarantee.



ASP.NET Cloud Hosting with ASPHostPortal.com:: How to Encrypt and Decrypt Password Using ASP.NET

clock April 11, 2014 12:40 by author Ben

Encryption is the process of translating plain text data into something that appears to be random and meaningless. Decryption is the process of translating random and meaningless data to plain text. Why we need to use this Encryption and decryption processes. By using this process we can hide original data and display some junk data based on this we can provide some security for our data. Here I will explain how to encrypt data and how to save that data into database after that I will show how to decrypt that encrypted data in database and how we can display that decrypted data on form. I have a form with four fileds username, password, firstname, lastname here I am encrypting password data and saving that data into database after that I am getting from database and decrypting the encrypted password data and displaying that data using gridview.

 


Please write this syntax code :


After that add System.Text namespace in code behind because in this namespace contains classes representing ASCII and Unicode character encodings. After that add following code in code behind and design one table in database with four fields and give name as "SampleUserdetails".

private const string strconneciton = "Data Source=MYCBJ017550027;Initial Catalog=MySamplesDB;Integrated Security=True";
SqlConnection con = new SqlConnection(strconneciton);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindencryptedData();
BindDecryptedData();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string strpassword = Encryptdata(txtPassword.Text);
con.Open();
SqlCommand cmd = new SqlCommand("insert into SampleUserdetails(UserName,Password,FirstName,LastName) values('" + txtname.Text + "','" + strpassword + "','" + txtfname.Text + "','" + txtlname.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
BindencryptedData();
BindDecryptedData();
}
protected void BindencryptedData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from SampleUserdetails", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
gvUsers.DataSource = ds;
gvUsers.DataBind();
con.Close();
}
protected void BindDecryptedData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from SampleUserdetails", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
gvdecryption.DataSource = ds;
gvdecryption.DataBind();
con.Close();
}
private string Encryptdata(string password)
{
string strmsg = string.Empty;
byte[] encode = new byte[password.Length];
encode = Encoding.UTF8.GetBytes(password);
strmsg = Convert.ToBase64String(encode);
return strmsg;
}
private string Decryptdata(string encryptpwd)
{
string decryptpwd = string.Empty;
UTF8Encoding encodepwd = new UTF8Encoding();
Decoder Decode = encodepwd.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(encryptpwd);
int charCount = Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
char[] decoded_char = new char[charCount];
Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
decryptpwd = new String(decoded_char);
return decryptpwd;
}
protected void gvdecryption_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string decryptpassword = e.Row.Cells[2].Text;
e.Row.Cells[2].Text = Decryptdata(decryptpassword);
}
}

And the result 

 


Happy Programming !!!

Need ASP.NET cloud hosting? Please visit our site at http://www.asphostportal.com. Just with only $4.00/month to get ASP.NET cloud hosting. If you have any further questions, please feel free to email us at [email protected].

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year.

 



ASP.Net Hosting – ASPHostPortal.com :: How to Use NumericUpDownExtender in ASP.Net AJAX

clock February 24, 2014 05:09 by author Diego

NumericUpDown is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to add "up" and "down" buttons that increment and decrement the value in the TextBox. The increment and decrement can be simple +1/-1 arithmetic, they can cycle through a provided list of values (like the months of the year), or they can call a Web Service to determine the next value. Page authors can also provide custom images to be used instead of the default up/down button graphics. In this article, I will show you step by step procedure, how to use a Up Down Extender

In ASP.NET using Visual Studio 2005 or Visual Studio 2008.

Step 1 : Open Visual Studio.

  • Go to File->New->WebSite
  • Select ASP.NET WebSite

Step 2 :

Under Visual Studio Installed Template-> Choose ASP.NET WEB SITE -> Choose File System from the location combo box -> Set the path by the browse button - > Choose the language from the Language ComboBox (Visual C# , Visual Basic , J #)

  • Choose Visual C#

Step 3 :

Click on the OK Button.
This is the source code window :

Step 4 :
See here is a tab named Design in the bottom of this page. Click on this tab and you will see a blank web page where you can drag any control from the toolbox (which is in the left side of this window).

Step 5 :
Now drag some controls under the AJAX Extensions. First control you are going to drag and drop on the page is - Script Manager.

  • first add a tag on the top of your source code window:
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  • Under the form tag,NumericUpDownExtender control

Step 6:

Now run the application by pressing ctrl +  F5.

Step 7 :

When you run the Up Down Extender will seem like this...

 



ASP.NET 4.5.1 Hosting - ASPHostPortal.com :: How to Create a Sign Up/Registration Page in ASP.NET

clock January 10, 2014 07:17 by author Ben

Here is the simple step to create a sign up/registration page in ASP.NET. Lets check this out :
1. Open the Microsoft Visual Studio
2. Select one New Asp.Net Web application
3. Open the Design Default.aspx page
4. Drag and Drop one DropDown list and button from the Tool box.
5. Add one new item( i.e., New Registration Page) for the Drop down list
6. Procedure for adding items : Right click on the DropDown List and select properties and select items and add NewRegistration in Text Field.
7. Change the properties of the Dropdown list
a.Kept AutopostBack = True;
b.select the SelectedIndexChanged Event for that..
8. Open the code page that is Default.aspx.cs and and create a method in SelectedIndexChanged event of dropdownlist

using System; 
using System.Collections; 
using System.Configuration; 
using System.Data; 
using System.Linq; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using System.Web.UI.HtmlControls; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Xml.Linq; 
using System.Data.SqlClient; 
 
public partial class Dynamic_controls : System.Web.UI.Page 

    SqlConnection con; 
    SqlCommand com; 
  protected void Page_Load(object sender, EventArgs e) 
    {        
        
    } 
protected void ddlist_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        Createnewaccount();  
    } 

9. Create new methods for Different controls by using the main method(i.e., Createnewaccount)

private void Createnewaccount ()
         {
             CreateDynamicTextBoxes ();
             CreateDynamicTextBoxes1 ();
             CreateDynamicCheckBoxes ();
             CreateDynamicCheckBoxes1 ();
             CreateDynamicRadioButtons1 ();
             BindDropDownLists ();
         }

10. Create all types of dynamic controls

 protected void CreateDynamicTextBoxes ( )
        {
           
            int c = 1 ;
            TextBox [ ] textBoxArr = new TextBox [ c ] ;/ / array of textboxes
            for (int i = 0 ; i < c ; i + + )
            {
                 
                textBoxArr [ i ] = new TextBox ( ) ;
                textBoxArr [ i ] . ID = " txtBox " + i.ToString ( ) ;
                PH_Name.Controls.Add ( textBoxArr [ i ] ) ;
                RequiredFieldValidator reqfldVal = new RequiredFieldValidator ( ) ;
                reqfldVal.ID = " RequiredValidator " + i ;
                reqfldVal.ControlToValidate = " txtBox " + i ;
                reqfldVal.ErrorMessage = " Not Empty " ;
                reqfldVal.SetFocusOnError = true ;
                PH_Name.Controls.Add ( reqfldVal ) ;
            }
        }
        protected void CreateDynamicTextBoxes1 ( )
        {
            int c = 1 ;
            TextBox [ ] textBoxArr1 = new TextBox [ c ] ;/ / array of textboxes
            for (int i = 0 ; i < c ; i + + )
            {
      
                textBoxArr1 [ i ] = new TextBox ( ) ;
                textBoxArr1 [ i ] . ID = " txtBox1 " + i.ToString ( ) ;
                PH_pwd.Controls.Add ( textBoxArr1 [ i ] ) ;
                RequiredFieldValidator reqfldVal1 = new RequiredFieldValidator ( ) ;
                reqfldVal1.ID = " RequiredValidator1 " + i ;
                reqfldVal1.ControlToValidate = " txtBox1 " + i ;
                reqfldVal1.ErrorMessage = " Not Empty " ;
                reqfldVal1.SetFocusOnError = true ;
                PH_pwd.Controls.Add ( reqfldVal1 ) ;
                 
            }
        }
        private void BindDropDownLists ( )
        {
            SqlDataSource sqlDS = new SqlDataSource ( ) ;
            sqlDS.ConnectionString = ConfigurationManager.ConnectionStrings [ " SAMPLE_2 " ] . ToString ( ) ;
            sqlDS.SelectCommand = " Select CountryID , COUNTRY_NAME from countrynames " ;
            PH_country.Controls.Add ( sqlDS ) ;
            DropDownList ddl = new DropDownList ( ) ;
            ddl.ID = " ddlrank " ;
            ddl.DataSource = sqlDS ;
            ddl.DataTextField = " COUNTRY_NAME " ;
            ddl.DataValueField = " CountryID " ;
            PH_country.Controls.Add ( ddI ) ;
            foreach ( Control ctl in PH_country.Controls )
            {
                if ( ctl is DropDownList )
                {
                    ( ctl as DropDownList ) . DataBind ( ) ;
                }
            }
        }
        protected void CreateDynamicCheckBoxes ( )
        {
                   
                CheckBox chk ;
                chk = new CheckBox ( ) ;
                chk.ID = " chkhobbies " ;
                chk.Text = " savings " ;
                chk.AutoPostBack = false ;
                PH_trans.Controls.Add ( chk ) ;
             
        }
        protected void CreateDynamicCheckBoxes1 ( )
        {
           
            int c = 1 ;
            CheckBox [ ] chk = new CheckBox [ c ] ;
            for (int i = 0 ; i < c ; i + + )
            {
                chk [ i ] = new CheckBox ( ) ;
                chk [ i ] . ID = " chkhobbies1 " + i.ToString ( ) ;
                chk [ i ] . Text = " Current" ;
                chk [ i ] . AutoPostBack = false ;
                PH_trans.Controls.Add ( chk [ i ] ) ;
            }
        }
        protected void CreateDynamicRadioButtons ( )
        {
                Male = new RadioButton RadioButton ( ) ;
                Female = new RadioButton RadioButton ( ) ;
                male = new RadioButton ( ) ;
                female = new RadioButton ( ) ;
                male.Text = " Male " ;
                female.Text = " Female " ;
                male.Checked = false ;
                female.Checked = false ;
                male.GroupName = " unknown " ;
                female.GroupName = " unknown " ;
                male.ID = " malegender " ;
                female.ID = " unknown " ;
                male.AutoPostBack = false ;
                female.AutoPostBack = false ;
                PH_gender.Controls.Add ( male ) ;
                PH_gender.Controls.Add (female ) ;
        }
        protected void CreateDynamicRadioButtons1 ( )
        {
            RadioButtonList radio = new RadioButtonList ( ) ;
            radio.ID = " rblRow " ;
            radio.Items.Add ( new ListItem ( " Male " ) ) ;
            radio.Items.Add ( new ListItem ( " Female " ) ) ;
            PH_gender.Controls.Add ( radio ) ;
             
        }
        protected void CreateDynamicPanel ( )
        {
           
            int c = 1 ;
            TextPanel panel = new Panel ( ) ;
            for (int i = 0 ; i < c ; i + + )
            {
                TextPanel.ID = " txtPanel " + i.ToString ( ) ;
                PlaceHolder1.Controls.Add ( TextPanel ) ;
            }
        }

11. Add the following code to store the data in database

protected void btn_submit_Click ( object sender , EventArgs e )
        {
            for (int i = 0 ; i < 1 ; i + + )
            {
                 
                txtvalue string = " txtBox " + i.ToString ( ) ;
                txtvalue1 string = " txtBox1 " + i.ToString ( ) ;
                ddlvalue string = " ddlrank " ;
                chkvalue string = " chkhobbies " ;
                chkvalue1 string = " chkhobbies1 " + i.ToString ( ) ;
                rbvalue string = " rblRow " ;
                 
                TextBox txt = ( TextBox ) PlaceHolder1.FindControl ( txtvalue ) ;
                TextBox txt1 = ( TextBox ) PlaceHolder1.FindControl ( txtvalue1 ) ;
                DropDownList Dddl = ( DropDownList ) PlaceHolder1.FindControl ( ddlvalue ) ;
                CheckBox Dchk = ( CheckBox ) PlaceHolder1.FindControl ( chkvalue ) ;
                CheckBox Dchk1 = ( CheckBox ) PlaceHolder1.FindControl ( chkvalue1 ) ;
                RadioButtonList Drd = ( RadioButtonList ) PlaceHolder1.FindControl ( rbvalue ) ;
                if ( txt ! = null )
                {
                    try
                    {
                        string strText = txt.Text ;
                        strText1 string = txt1.Text ;
                        strddl string = Dddl.SelectedItem.Text ;
                        strchk string = Dchk.Text ;
                        strchk1 string = Dchk1.Text ;
                        strrdb string = Drd.Text ;
                        / / Store value in database textbox Cell
                        con = new SqlConnection ( ConfigurationManager.ConnectionStrings [ " SAMPLE_2 " ] . ToString ( ) ) ;
                        con.Open ( ) ;
                        com = new SqlCommand ( " insert into Dynamic_Form ( UserName , LastName , DropdownlistValue , Chksavings , Chkcurrent , Radiovalue ) values ​​( ' " + strText + " ' , ' " + strText1 + " ' , ' " + strddl + " ' , ' " strchk + + " ' , ' " + strchk1 + " ' , ' " + strrdb + " ' ) " , con ) ;
                        com.ExecuteNonQuery ( ) ;
                        con.Close ( ) ;
                        lbl_error.Text = " Account Successfully Created " ;
                         
                    }
                    catch ( Exception ex )
                    {
                        throw ex ;
                        / / lbl_error.Text = " There is a problem while creating Account " ;
                         
                    }
                }
            }
        }

Now, run your program and see the result :



Free ASP.NET 4.5.1 Hosting - ASPHostPortal :: How To Create and Delete Cookies Using ASP.NET

clock December 10, 2013 06:24 by author Ben

Cookies is a small piece of information stored on the client machine. This file is located on client machines "C:\Document and Settings\Currently_Login user\Cookie" path.  Its is used to store user preference information like Username, Password,City and PhoneNo etc on client machines that you created in ASP.NET.
Cookies could be stolen by hackers to gain access to a victim's web account. Even cookies are not software and they cannot be programmed like normal executable applications. Cookies cannot carry viruses and cannot install malware on the host computer. However, they can be used by spyware to track user's browsing activities.

How to create a cookie?
There are many ways to create cookies, I am going to outline some of them below:
Example 1:
HttpCookie userInfo = new HttpCookie("userInfo");
userInfo["UserName"] = "Annathurai";
userInfo["UserColor"] = "Black";
userInfo.Expires.Add(new TimeSpan(0, 1, 0));
Response.Cookies.Add(userInfo);


Example 2:
Response.Cookies["userName"].Value = "Annathurai";
Response.Cookies["userColor"].Value = "Black";


How to delete cookie?
Now look at the code given below which will delete cookies.
Example 1:
string User_Name = string.Empty;
string User_Color = string.Empty;
User_Name = Request.Cookies["userName"].Value;
User_Color = Request.Cookies["userColor"].Value;

Example 2:
string User_name = string.Empty;
string User_color = string.Empty;
HttpCookie reqCookies = Request.Cookies["userInfo"];
if (reqCookies != null)
{
User_name = reqCookies["UserName"].ToString();
User_color = reqCookies["UserColor"].ToString();
}


When we make request from client to web server, the web server process the request and give the lot of information with big pockets  which will have Header information, Metadata, cookies etc., Then repose object can do all the things with browser.

Cookie's common property:

  • Domain => Which is used to associate cookies to domain.
  • Secure  => We can enable secure cookie to set true(HTTPs).
  • Value    => We can manipulate individual cookie.
  • Values  => We can manipulate cookies with key/value pair.
  • Expires => Which is used to set expire date for the cookies.


Advantages of Cookie:

  • Its clear text so user can able to read it.
  • We can store user preference information on the client machine.
  • Its easy way to maintain.
  • Fast accessing.
  • Disadvantages of Cookie
  • If user clear cookie information we can't get it back.
  • No security.
  • Each request will have cookie information with page.


How to clear the cookie information?
we can clear cookie information from client machine on cookie folder

To set expires to cookie object
userInfo.Expires = DateTime.Now.AddHours(1);
It will clear the cookie with one hour duration.


Our Special ASP.NET 4.5.1 Hosting Complete Features

  1. 24/7 Monitoring, We do 24/7 monitoring of your ASP.NET to make sure that we proactively kill any trouble. This helps to ensure maximum uptime and performance.
  2. Easy-to-use service (1-click installs), ASPHostPortal.com gives you access to all SimpleScripts features, provides easy one-click installation and management of all popular applications.
  3. Fast and Secure Server, Our powerfull servers are especially optimized and ensure the best ASP.NET 4.5.1 performance. We have best data centers on three continent and unique account isolation for security.
  4. Daily Backup Service, We realise that your website is very important to your business and hence, we never ever forget to create a daily backup. Your database and website are backup every night into a permanent remote tape drive to ensure that they are always safe and secure. The backup is always ready and available anytime you need it.



ASP.NET 4.0 Hosting - ASPHostPortal.com :: Handling Error HTTP Error 500.19 - Internal Server Error - There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler'section defined

clock September 18, 2013 11:08 by author Ben

have you ever come across this error when you try to run your website from localhost??




and when I looking for the real problem in production server, I understand that version. NET Framework that I use is 4.0. for that I need to replace the actual version .NET Framework version 2.0.



Here is a short step to change. NET version:

1. Open your IIS ( for this article i use IIS 8)
2. Click your Application Pool (Before that, make sure your dedicated pool was tick on your server) and search your domain name.
    You'll find that your .NET Framework version is 4.0. (this version is default by plesk control panel 11)
3. Click Basic Setting.

4. then change .NET Framework version to 2.0 - Ok


5. Yeah.. now you can reload your web browser and check your website.

 



ASP.NET 2.0 Hosting :: Tips for Shared Functions

clock June 7, 2013 07:52 by author Ben

When developing a recent project for ASP.NET, there was a need to migrate a large number of generic functions that were created in PHP into the .net web project. For .net 1.0, you were able to add a code page that could be used for creating a bunch of functions. However, in ASP.net 2.0, you still had the ability to add a code page, but it had to be a class. This meant placing all of our migrated functions as methods inside a class. To use a generic function, such as generateNewPassword(), you would have to first create a new object for the class and then call the method.

Example:
Dim objGenericFunctions as new GenericFunctions()
blnPasswordSent = generateNewPassword(firstName, lastName, email)

There are a couple of problems with this technique. First, since .net 2.0 encourages object-oriented programming, you could either create objGenericFunctions() once and pass the object as a parameter to other classes. But this requires extra code management, especially when there are classes that call other classes that might need to use some of those Generic Functions from objGenericFunctions. Or you could create a new objGenericfunctions whenever you need it, but this means creating a number of objects for the GenericFunctions class, which seems to be a waste of system resources.

In developing classes for PHP 5.0, you could declare a class function as static. Which allowed you to use that method without having to create a new object. After some googling, I learned that VB.net also has a similar declaration, but they call it shared. So, by declaring a class function as shared, there's no need to create a new object each time.
Example:

blnPasswordSent = GenericFunctions.generateNewPassword(firstName, lastName, email)

Here's a sample class with a shared function:
Imports Microsoft.VisualBasic
Imports System.Web
Public Class GenericFunctions
   Public Shared Function isDateInRange(ByVal dateStart As DateTime, ByVal dateEnd As DateTime, ByVal dateCompare As DateTime) As Boolean
        Dim blnInRange As Boolean = False
        Dim intStartDiff As Integer = 0
        Dim intEndDiff As Integer = 0
        intStartDiff = Date.Compare(dateStart, dateCompare)
        intEndDiff = Date.Compare(dateCompare, dateEnd)
        If intStartDiff <= 0 And intEndDiff <= 0 Then
            blnInRange = True
        End If
        Return blnInRange
    End Function
End Class

We can take this one step for further by adding a namespace declaration to the class. By using a namespace, we can now add Imports GenericFunctions to the top of a code page and access those methods without having to type GenericFunctions first.

Sample of Namespace declaration:
Imports Microsoft.VisualBasic
Imports System.Web
Namespace GenericFunctions
    Public Class GenericFunctions
        ' Place all the functions here...
    End Class
End Namespace

Example of using the Imports statement:
Default.aspx.vb - Code Behind

Imports GenericFunctions
Partial Class Default
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender as Object, ByVal e As System.EventArgs) Handles Me.Load
        'No longer need to start with GenericFunctions
        blnPasswordSent =generateNewPassword(firstName, lastName, email)
    End Sub
End Class



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

 photo ahp banner aspnet-01_zps87l92lcl.png

 

Corporate Address (Location)

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

Tag cloud

Sign in