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 4 Hosting - ASPHostPortal :: Tutorial - How to Send Email with Attachment in ASP.NET

clock July 30, 2011 07:00 by author Jervis

In this article i am going to explain to send mail by using multiple attachment in ASP.NET.

Now In this article you can send a mail with attachment.Its very easy process, add fileupload control from the toolbox and design a page like below ,then add the following code..



First you have to import the namespace....

system.net.mail

Then write the below code in Send Button Click Event.......


 Dim mail As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
        Dim attach1 As String
        mail.To.Add(TextBox2.Text)
'checking CC and BCC textbox empty or Not
        If Not TextBox3.Text = "" Then
            mail.CC.Add(TextBox3.Text)
        End If
        If Not TextBox4.Text = "" Then
            mail.Bcc.Add(TextBox4.Text)
        End If
 mail.Subject = TextBox5.Text
        mail.From = New MailAddress(TextBox1.Text)
        mail.Body = TextBox6.Text
If attachment.HasFile Then           

mail.Attachments.Add(New Attachment(attachment.PostedFile.InputStream, attachment.FileName))
        End If
        If attachment2.HasFile Then
            mail.Attachments.Add(New Attachment(attachment2.PostedFile.InputStream, attachment2.FileName))
        End If 

        mail.IsBodyHtml = True
        Dim smtp As SmtpClient = New SmtpClient()
        smtp.Host = "smtp.gmail.com"
               smtp.Credentials = New
System.Net.NetworkCredential("Gmailusername", "password")
        smtp.EnableSsl = True
        Label1.Text = "Your mail has sent"
        Try
            smtp.Send(mail)
        Catch ex As Exception
            Label1.Text = "The email cannot be sent" + ex.ToString()
        End Try
 

For Sending mail through yahoo you have to change following thing in the above code...

smtp.Host = "smtp.mail.yahoo.com"
smpt.port=25
smtp.EnableSsl = False
smtp.Credentials = New System.Net.NetworkCredential("Yahoousername", "password")

Hope it helps

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. The followings are the list of other added- benefits you can find when hosting with us:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET Hosting - ASPHostPortal :: Using ASP.NET to Store ImageURL in Database and View the Image Through Gridview

clock July 26, 2011 06:05 by author Jervis

This brief tutorial describes how to store imageURL in Database and View the image through gridview using ASP.NET. Just follow this steps you have to do:

Click Solution Explorer add a new folder with name Image.

Create A DataBase should be like this.......



Design client side page like Below,Further follow the code for design



Client Side Coding

<body>
    <form id="form1" runat="server">
    <div>
    <table cellpadding ="0" cellspacing ="0" width="500" align="center" >
    <tr>
    <td height="100"></td>
    
    </tr>
    <tr>
    <td>
    Name:
    </td>
    <td>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </td>
    
    </tr>
    <tr>
    <td>
    Image:
    </td>
    <td>
    <asp:FileUpload ID="FileUpload1" runat="server" />
    </td>
    
    
    </tr>
    <tr>
    <td height="30">
    
    </td>
    
    </tr>
    <tr>
    <td  align="justify"  >
    
        <asp:Button ID="Button1" runat="server" Text="ADD" />
    </td>
    <td>
        <asp:Label ID="Label1" runat="server"></asp:Label>
    </td>
    </tr>
    <tr>
    <td colspan ="2">
    <asp:Button ID="Button2" runat="server" Text="Show all" />
    </td>
        
    </tr>
    <tr>
    <td colspan ="2">
        <asp:GridView ID="imggrid" runat="server" AutoGenerateColumns ="false" Width="500px" DataKeyNames ="Sno" > 
        
        <Columns >
        <asp:TemplateField HeaderText ="SNO" >
        <ItemTemplate >
        <%#Eval("Sno")%>
        </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText ="Name" >
        <ItemTemplate>
        <%#Eval("Name")%>
        </ItemTemplate>
        
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Image">
        <ItemTemplate >
            <asp:Image ID="Image1" runat="server" ImageUrl ='<%#eval("ImageURL") %>' height="100px" Width="100px" />
        </ItemTemplate>
        </asp:TemplateField>
        <asp:CommandField HeaderText ="Modify" ShowEditButton ="true" ShowDeleteButton ="false" EditText ="Modify" />
        <asp:TemplateField Headertext="Delete">
        <ItemTemplate >
                    <asp:LinkButton ID="lnkdelete" runat="server" CommandName ="Delete">Delete</asp:LinkButton>
        </ItemTemplate>
        
        </asp:TemplateField>
        </Columns>
        </asp:GridView>
    
    
    </td>
    
    </tr>
    </table>
    </div>
    </form>
</body>

Server Side Coding:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim imgext As String
        Dim imgpath As String
        Dim fname As String


        con.ConnectionString = ConfigurationManager.ConnectionStrings("con").ConnectionString


        If FileUpload1.HasFile Then
            imgext = FileUpload1.FileName.Substring(FileUpload1.FileName.LastIndexOf(".") + 1).ToLower


            'Get the max Sno from the table
            maxid()
            fname = TextBox1.Text
            filename = id + (FileUpload1.FileName)
            If (imgext = "jpg" Or imgext = "gif" Or imgext = "bmp") Then
                imgpath = "~/image/" + filename
                FileUpload1.SaveAs(Server.MapPath("~/image/") + filename)
            Else
                Label1.Text = "update only jpg,gif and bmp file"
            End If
            'Insert image Path into Database
            fselect = "insert into imgurl values('" & id & "','" & fname & "','" & imgpath & "')"
            sqlcmd = New SqlCommand(fselect, con)
            con.Open()
            sqlcmd.ExecuteNonQuery()
            con.Close()
            Label1.Text = "image Upload Succesfully"
            loadgrid()
        End If
    End Sub
    Sub maxid()
        con.ConnectionString = ConfigurationManager.ConnectionStrings("con").ConnectionString


        fselect = "select isnull(max(Sno)+1,1) as id from imgurl"
        sqlcmd = New SqlCommand(fselect, con)
        con.Open()
        sqladp = New SqlDataAdapter(sqlcmd)
        ds = New DataSet
        sqladp.Fill(ds)
        dt = ds.Tables(0)
        If dt.Rows.Count > 0 Then
            id = dt.Rows(0).Item("id")


        End If
        con.Close()
    End Sub
    Sub loadgrid()
        con.ConnectionString = ConfigurationManager.ConnectionStrings("con").ConnectionString
        fselect = "select * from imgurl"
        sqlcmd = New SqlCommand(fselect, con)
        con.Open()


        sqldr = sqlcmd.ExecuteReader()
        If sqldr.HasRows Then
            imggrid.DataSource = sqldr
            imggrid.DataBind()
            imggrid.Columns(0).Visible = False
        Else
            imggrid.DataSource = sqldr
            imggrid.DataBind()
            imggrid.Columns(0).Visible = False
        End If
        con.Close()
    End Sub
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        loadgrid()
    End Sub
    Protected Sub imggrid_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles imggrid.RowDeleting
        Dim sno As Integer
        Dim url As String
        Dim fpath As String
        con.ConnectionString = ConfigurationManager.ConnectionStrings("con").ConnectionString
        sno = imggrid.DataKeys(e.RowIndex).Value.ToString
        fselect = "select imageURL from imgurl where sno='" & sno & "'"
        sqlcmd = New SqlCommand(fselect, con)
        con.Open()
        sqladp = New SqlDataAdapter(sqlcmd)
        con.Close()
        ds = New DataSet
        sqladp.Fill(ds)
        dt = ds.Tables(0)
        If dt.Rows.Count > 0 Then
            url = dt.Rows(0).Item("imageURL")


        End If


        fselect = "delete from imgurl where sno='" & sno & "'"
        sqlcmd = New SqlCommand(fselect, con)
        con.Open()
        sqlcmd.ExecuteNonQuery()
        con.Close()
        'Delete the imgae File from that folder
        fpath = Server.MapPath(url)
        System.IO.File.Delete(fpath)
        loadgrid()
    End Sub

Hope it helps

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. The followings are the list of other added- benefits you can find when hosting with us:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET Hosting - ASPHostPortal :: How to Fix Error - The Controls collection cannot be modified because the control contains code blocks

clock July 22, 2011 06:01 by author Jervis

Server Error in '/' Application



The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Exception Details:
System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:


Line 132:                        metaKey.Name = "keywords";
Line 133:                        metaKey.Content = p.MetaKeywords;
Line 134:                        this.Page.Header.Controls.Add(metaKey);
Line 135:                    }
Line 136:                    if (!String.IsNullOrEmpty(p.MetaDescription))


Source File:
a:\xyz\ContentHandler.aspx.cs    Line: 134

Stack Trace:


[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +2105903
   ContentHandler.Page_Load(Object sender, EventArgs e) in a:\xyz\ContentHandler.aspx.cs:134
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


Version Information:
 Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

How to Fix it?

It is really simple, just remove the inline code blocks and JavaScript and move it to your code behind i.e

string _manageSearch = String.Format( @" 
        function ManageSearch(){{
                var lbl = document.getElementById(""lblFindAGift"");
                var txt = document.getElementById(""{0}"");
                var btn = document.getElementById(""{1}"");

                .Do Something with it..

        }}",

        txtSearch.ClientID);

this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ManageSearch", _manageSearch, true);


Simple, right? Good luck. Hope it helps!!

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. The followings are the list of other added- benefits you can find when hosting with us:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: ASP.NET 4.0 Session State

clock July 21, 2011 06:58 by author Jervis

This post explains about Shrinking session state in ASP.NET 4.0

ASP.NET Provides two options for storing session state for web applications.

1. Out of process session state
2. MS SQL server session state

In both the options session-state providers stores the data out side the web application   worker process. Session state has to be serialized before it sends it to the external storage.

ASP.NET 4.0 introduces a new compression option for both out-of-process session state providers. We can set the compressionEnabled option in configuration file to true. ASP.NET will compress the session state by using the .NET Framework System.IO.Compression.GZipStream class.

We can configure the session state as follows

<sessionState
    mode="SqlServer"
    sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate"
    allowCustomSqlDatabase="true"
    compressionEnabled="true"
/>

Advantage: With this addition of attribute to web.config file there is substantial reduction in the size of serialized session-state data.

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. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: How To Style a GridView with CSS in ASP.NET 4.0

clock July 19, 2011 08:28 by author Jervis

Adding the Database

To demonstrate how to apply styles to a gridview we will need to create a simple web site with a database to populate the gridview with data. Then, we will need to add in some CSS to style it. To begin, create a new ASP.NET Empty Web Site. Then, to add the database:

1. Right click the project in your solution explorer.
2. Select add ASP.NET folder.
3. Select App_Data.
4. Right click the App_Data folder in your solution explorer.
5. Select add new item…
6. Select a Sql Server Database.
7. Click add.

Now that we have a database, we need to add a table to it with some sample data. To do this:

1. Expand the Database.mdf folder in your server/database explorer.
2. Right click the Tables folder.
3. Select add new table.
4. Add the following columns with their respective types to the table:

Column Name

Data Type 

 ID

 int 

 Data

 nvarchar(50)


5. Save the table as ‘Table1’

Next, add the following sample data to Table1:

ID 

Data 

 1

 Temp data 1 

 2

 Temp data 2

 3

 Temp data 3

 4

 Temp data 4


Adding the Default.aspx Page

Next, we need to add a web form with a gridview on it. To do this:


1. Right click the project in your solution explorer.
2. Select add new item…
3. Select a web form.
4. Name it ‘Default.aspx’.
5. Click add.
6. Open Default.aspx up to design mode.
7. Drag and drop a gridview control onto the web form.
8. Expand the GridView Tasks menu.
9. From the Choose Data Source dropdownlist select <New data source…>.
10. Select a SQL Database and click OK.
11. Use the dropdown list to select Database.mdf and click Next.
12. Choose to save the connection string and click Next.
13. Click Next leaving the default select statement.
14. Finally, you can test your query and ensure that it is correct and click Finish.

Adding the CSS StyleSheet


Next, we need to add a new CSS style sheet to the project to which we will add our CSS classes. To do this:

1. Right click the project in your solution explorer.
2. Select add new item…
3. Select a style sheet.
4. Name it ‘StyleSheet.css’.
5. Click add.

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. The followings are the list of other added- benefits you can find when hosting with us:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: Implementing Paging Functionality in ASP-GridView

clock July 15, 2011 07:13 by author Jervis

When you bind a GridView to any of the Data Sources (i.e. asp:SqlDataSource, asp:AccessDataSource or asp:ObjectDataSource ) and set its AllowPaging property to "true", the underlying paging functionality for the GridView is automatically handled. There are situations when you prefer to bind Grid with a simple DataTable instead of a DataSource. In that case paging events should be handled manually.

First of all drag an asp:GridView control to the web form and set its AllowPaging property to "true". In order to implement paging functionality in GridView, the ‘onpageindexchanging’ event should be handled. Double click on onpageindexchanging event of GridView to insert its even handler. Below is the aspx GridView source

<asp:GridView ID="GridView1" runat="server"
AllowPaging="True" 
onpageindexchanging="gridView1_PageIndexChanging">
<Columns>
</Columns>
</asp:GridView>

Now populate a DataTable (to be bound with GridView) with the desired data. Then write a DataBindGrid function that is used to bind GridView to this DataTable. Below is code:

private void DataBindGrid()
{
    DataTable dt = GetDataTable("sql string");
    this.GridView1.DataSource = dt;
    this.GridView1.DataBind();
}

Reason behind is you have to call this function twice (i.e. in page load event and in gidview1_PageIndexChanging event).

Below is the code

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
        DataBindGrid();
}
protected void gridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    GridView1.PageIndex = e.NewPageIndex;
    DataBindGrid();
}

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. The followings are the list of other added- benefits you can find when hosting with us:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: How to Change ASP.NET Temporary Files Folder

clock July 11, 2011 07:46 by author Jervis

One of my client was having problems with the small space on the C drive on a server machine which was hosting a ASP.net application. There were few errors in the server error about “No enough space”.Though I would say that in ideal situation it would be best to increase the space on the C: drive as most of the other Operating System related applications also reply on the free space on C: drive, when there is no other easy way of increasing the space on C: drive, administrator can relocate the temporary files folder created by ASP.net.

Please note that ASP.net create a compile version of the site and stores it in its default temporary ASP.net folder. This is usually %Windows Install Folder%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files (For ASP.Net 2.0). This folder can grow very fast in case web server has large ASP.net sites hosted on that server. Fortunately, ASP.net provides a simple way to change this location. This is stored in the web.config file and can defined in the Global web.config (placed at %Windows Install Folder%Microsoft.NET\Framework\v2.0.50727\CONFIG). To change this path add the new full folder path in the Compilation section of the configuration file. Here is a sample of how this looks like (this must be under System.Web section):

<compilation tempDirectory=“E:\ASP.Net Temporary Folder\” debug=“false“>


One can find the documentation of all different sections of ASP.net configuration file at:
http://msdn2.microsoft.com/en-us/library/b5ysx397(VS.71).aspx

In case when Internet is not available, or you just need a quick reference, there is also a small helpful file in the configuration folder. This file is named “web.config.comments” and is in the CONFIG folder of the ASP.net framework folder.

Please try it and good luck!!

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. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: Using JQuery With MasterPages in ASP.NET 4.0

clock July 8, 2011 07:34 by author Jervis

In this tutorial we will learn how to use JQuery with master pages in ASP.NET 4.0. Typically when you are working with an ASP.NET page, referencing external JavaScript libraries is easy. However, things get a little tricky when you begin working with master pages. Master pages do some weird things behind the scenes, that you will need to understand in order to be able to use JQuery on your pages effectively.

To begin, create a new ASP.NET Empty Web Site in Visual Studio. First, we will need to add a reference to JQuery. If you don’t have JQuery you can download it at
http://jquery.com/. Once you have it, you are ready to add it to your project. To do this:

1. Right click the project in your solution explorer.
2. Select ‘Add Existing Item…’.
3. Navigate to your JQuery file and select it.
4. Click add.

Now that we have the library local to our project, we will create a new master page to reference this from. To add a new master page:

1. Right click the project in your solution explorer.
2. Select ‘Add New Item…’.
3. Select a master page and name it ‘MasterPage.master’.
4. Click add.

Typically, when a reference or script is added to an ASP.NET page it is added in the head section. We will be adding our JQuery reference here, however we must be careful about our positioning. The master page also generated two ContentPlaceHolder sections. One in the head section appropriately named ‘head’, and the other in the body section named ‘ContentPlaceHolder1′. When we write scripts on our other web pages that will be using JQuery, we must ensure that the JQuery reference comes before the script using it. In this case, we will want to drag and drop the JQuery file into our head section, right about the ‘head’ content place holder. My new head section looks like the following:

<head runat="server">
    <title></title>
    <!-- We add all of our external references for our pages here -->
    <script src="jquery-1.6.js" type="text/javascript"></script>

    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>

Next, we need to add a new ASP.NET page to our project using our master page. To do this:

1. Right click the project in your solution explorer.
2. Select ‘Add New Item…’.
3. Select a new ASP.NET page and name it ‘Default.aspx’.
4. Click the ‘Select master page’ check box.
5. Click add.
6. Select ‘MasterPage.master’ and click OK.

Cool, we now have a new page using our master page. This page contains two Content sections that correspond to the ContentPlaceHolder sections of our master page. In this case, we will add some test code to our ‘head’ content section which will use some JQuery. It is important to note that this will work here only because we have configured our master page to have a reference to JQuery before our scripts on this page are read.

To this page, go ahead and add a new button with a Text property of ‘Click Me’, and an OnClientClick property of ‘ButtonClick()’. Next, add the following code to the ‘head’ content section:

<script type="text/javascript">
    function ButtonClick() {
        alert($('#ContentPlaceHolder1_Button1').val());
    }
</script>

This is a simple script that will grab our button by its ID and display the value it holds. It is important to note that Microsoft’s naming standards come into play here when you place controls inside of content place holders. If you were to look at the generated HTML of the page, you would notice that our ‘Button1′ control has an ID of ‘ContentPlaceHolder1_Button1′. This is because the content place holder it is in is added to the beginning of the control, separated by an underscore.

To test this out, load up the web site and click the button. You should see an alert box that displays the message ‘Click Me’ which corresponds to the text in our button. This demonstrates how to set up your master pages to work easily with JQuery. I hope that this helps, happy coding!

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. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: How to Post Message from Your ASP.NET Site to Twitter

clock July 7, 2011 05:40 by author Jervis

Practical Example for Twitter Programming in .Net

1.
Download Twitterizer API for Twitter Programming in .Net

2. Create New Asp.net Website. 

3. Arrange the Web Controls as shown in Figure.

4. Add Twitterizer Reference.

Right Click Website in Solution Explorer, and select "Add Reference" from Popup dialog.

Add the Twitterizer.Framework.dll which you have downloaded in Step1.

5. Write the code

Add Namespace: using Twitterizer.Framework;

Add following code on Shout button click event.
protected void btnShout_Click(object sender, EventArgs e)
{  
string TwitterUserName = "twitasp";
string TwitterPassword = "mypassword";
string TwitterMessage = txtShout.Text;

if (TwitterUserName != string.Empty && TwitterPassword != string.Empty)
{
try
{

Twitter twitter = new Twitter(TwitterUserName,TwitterPassword);

string TwitterMsg = txtShout.Text;
if (txtShout.Text.Length > 120)
{
TwitterMsg = TwitterMsg.Substring(0, 130) + "... For more update logon to
DailyFreeCode.com"
;

}
else
{
TwitterMsg = TwitterMsg + "... For more update logon to DailyFreeCode.com";
}
twitter.Status.Update(TwitterMsg);
lblTwitMsg.Text = "Your have shout successfully on http://twitter.com/" + TwitterUserName;

}
catch (Exception ex)
{
Response.Write("<b>" + ex.Message + "</b><br>" + ex.StackTrace);
}
}
}

Lets Post one Message from Asp.net Website Developed.

Type your Message in Textbox and Press Shout button, you can then check your Twitter website to check whether update is applied or not.

Now Press “Shout on Twitter!” button

Now check the Twitter Website for Profile we have Shout on. http://twitter.com/twitasp



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. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



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