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 Hosting - ASPHostPortal :: Call ASP.NET Page Methods using your own AJAX

clock September 20, 2011 08:46 by author Jervis

ASP.NET has grown very rich day by day. Recently Microsoft has introduced JQuery as a primary javascript development tool for client end application. Even though there is a number of flexibility in ASP.NET AJAX applications, many developers do seek place to actually call a page using normal AJAX based application. In this post I will cover how you can invoke an ASP.NET page method directly from your own AJAX library.

What are page methods?

A Page method is a method that is written directly in a page. It is generally called when the actual page is posted back and some event is raised from the client. The pageMethod is called directly from ASP.NET engine.

What is a WebMethod?

A WebMethod is a special method attribute that exposes a method directly as XML service. To implement PageMethod we first need to annotate our method as WebMethod.


Steps to Create the application :

1. Start a new ASP.NET Project.
2. Add JQuery to your page. I have added a special JQuery plugin myself which stringify a JSON object. The post looks like below :


(function ($) {
$.extend({
toJson: function (obj) {
var t = typeof (obj);
if (t != "object" || obj === null) {
// simple data type
if (t == "string") obj = '"' + obj + '"';
return String(obj);
}
else {
// recurse array or object
var n, v, json = [], arr = (obj && obj.constructor == Array);
for (n in obj) {
v = obj[n]; t = typeof (v);
if (t == "string") v = '"' + v + '"';
else if (t == "object" && v !== null) v = JSON.stringify(v);
json.push((arr ? "" : '"' + n + '":') + String(v));
}
return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
}
}
});
// extend plugin scope
$.fn.extend({
toJson: $.toJson.construct
});
})(jQuery);


The code actually extends JQuery to add a method called toJSON to its prototype.

3. Add the server side method to the Default.aspx page. For simplicity we actually return the message that is received from the client side with some formatting.

[WebMethod]
public static string DisplayTime(string message)
{
// Do something

return string.Format("Hello ! Your message : {0} at {1}", message, DateTime.Now.ToShortTimeString());
}


Remember : You should make this method static, and probably should return only serializable object.

4. Add the following Html which actually puts one TextBox which takes a message and a Button to call server.

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Welcome to ASP.NET!
</h2>
<p>
Write Your message Here : <input type="text" id="txtMessage" />
</p>
<p>
<input type="button" onclick="javascript:callServer()" value="Call Server" />
</p>
</asp:Content>


Once you add this html to your default.aspx page, add some javascript to the page. We add the JQuery and our JSONStringify code to it.

<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/JSONStringify.js" type="text/javascript"></script>

<script type="text/javascript">
function callServer() {
var objdata = {
"message" : $("#txtMessage").val()
};
$.ajax({
type: "POST",
url: "Default.aspx/DisplayTime",
data: $.toJson(objdata),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(msg.d);
},
error: function (xhr, ajaxOptions) {
alert(xhr.status);
}
});
}
</script>


The above code actually invokes a normal AJAX call to the page. You can use your own library of AJAX rather than JQuery to do the same. On success, it returns the serializable object to msg.d.

Output:



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 :: Navigation and Dynamic Sitemap in ASP.NET

clock September 8, 2011 06:45 by author Jervis

One big issue regarding web.sitemap as a source for ASP.NET navigation controls is the lack of dynamic updating. This means you need to manually add the new ASP.NET pages to your web.sitemap so that your navigation menu (which is using ASP.NET navigation controls such as SiteMapPath and TreeView) will include the newly added pages.

But manually updating web.sitemap can be a daunting task taking into consideration if you have a lot of new pages to be added to your site or you are managing an ASP.NET website with lots of pages.

This is where solutions to dynamically/automatically update your website navigation are important. In this tutorial, you will be using the ScionSitemapProvider as a tool to dynamic update your ASP.NET website navigation without the need to update the web.sitemap manually.

Demo Website Project using Basic Navigational Controls

In this tutorial you will be using a sample website project that you can use to illustrate the entire process of integrating the ScionSiteMapProvider to your own project. Follow the steps below:

1. Download the sample website project here:


http://www.dotnetdevelopment.net/tutorials/dynamicnavigationdemo.zip

This website project does not yet use ScionSitemapProvider to automatically update the website navigation menu when new pages are added. This is still using the web.sitemap as a source of navigational controls.

2. Right click on the zip file and click “Extract here”.

3. Copy the extracted folder named as “dynamicnavigationdemo” to your ASP.NET local project folders (where you will normally save all your ASP.NET projects).

4. Launch Visual Web Developer Express and go to File – Open Website -- look for dynamicnavigationdemo project, select it and click Open.

5. Go to Default.aspx source code then go to File – View in Browser. You should see the sample website as follows:




There are actually 4 ASP.NET pages in the root directory: Default.aspx (Homepage), Contact.aspx (Contact), Privacy.aspx (Privacy) and Terms.aspx (Terms). There is one directory named “About” with 3 child pages under it Default.aspx (About), John.aspx (John) and Peter.aspx (Peter)

If you are going to add new pages to either the root directory or inside the “About” directory, you will need to manually update the web.sitemap so that new pages will be reflected in the website navigation menu.

Integrate ScionSitemapProvider to your Website Project

The first step in dynamically updating your website navigation menu is to integrate ScionSitemapProvider. Follow the steps below:

1. Go to this page:
http://www.codeproject.com/KB/aspnet/ScionSiteMapProvider.aspx

2. Click the link that says “Download compiled assembly and GAC installer (v.1.1.0.0) - 14.7 KB”. You will need to login before you can download. Registration process is very quick.

3. After downloading, go to your Downloads folder and find the package “Tek4WebScionSiteMapProvider.zip”.

4. Right click on Tek4WebScionSiteMapProvider.zip then click "Extract to Tek4WebScionSiteMapProvider"

The folder is then extracted and inside the Tek4WebScionSiteMapProvider; you should see two files namely: Tek4.Web.ScionSiteMapProvider.dll and Tek4.Web.ScionSiteMapProvider.msi. In this tutorial you will be only using Tek4.Web.ScionSiteMapProvider.dll.

5. Go back to the dynamicnavigationdemo project in Visual Web Developer Express. Go to “Website” -- then click “Add Reference”. Click “Browse” tab. Browse where you have extracted the Tek4WebScionSiteMapProvider folder.

6. Once you see the Tek4WebScionSiteMapProvider folder, select Tek4.Web.ScionSiteMapProvider.dll and then click OK. This dll file will then be added to the Bin folder of your website project. You can see it in Solution Explorer.

7. You also need to update your web.config file to add ScionSitemapProvider as your sitemap provider. Double click web.config in Solution Explorer.

8. Copy and paste the code below just before </system.web> in web.config:

<siteMap defaultProvider="Tek4ScionSiteMapProvider">       
<providers>
<add siteMapFile="web.sitemap" name="Tek4ScionSiteMapProvider" inherit="true" scionTitle="Path" titleSeparator=" > "  type="Tek4.Web.ScionSiteMapProvider,Tek4.Web.ScionSiteMapProvider, Version=1.1.0.0, Culture=neutral, PublicKeyToken=26c804c56bafc725" defaultDocuments="default.aspx" description="Extends XmlSiteMapProvider to provide mapping for URLs that do not have a sitemap file entry by inheriting information from a parent entry." />  
</providers>

9. Go to File – Save all. You have successfully integrated ScionSitemapProvider.

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 Fix - Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

clock September 5, 2011 06:35 by author Jervis

Server Error in '/' Application



Configuration Error


Description
: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (e:\HostingSpaces\shmulik\albumisrael.co.il\wwwroot\web.config line 22)

Today, I will try my best to explain how to fix this error.

First, you need to find out why you getting this error.

1. Right click on project then add reference (add reference dialoge box will popup).
2. Search assembly from .net tab and add a reference.
3. If you are using project refernce select project reference and add reference of required assembly.
4. Also, you can find the assembly by browsing options.

Many tims assembly doesn't exists in computer, in that case you need to search it on web find the installables like AjaxControlToolkit or AjaxExtensions or for RIA etc... etc.. .

If you don;t have those assemblies on production server follow below steps.

Step:

1. Right click on reference assembly.
2. look at its property.
3. set copy local to true.

This will copy the assembly from GAC to your local bin folder and when you go live with your production server,  your application will start refering that assembly from bin folder instead of GAC folder of production server.

Another way to fix this issue, please go to http://www.microsoft.com/downloads/details.aspx?FamilyID=7b43bab5-a8ff-40ed-9c84-11abb9cda559&displaylang=en. Please install it on your server. That is a quick way.

Hope it help!!

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 Fix Could not load file or assembly Microsoft.ReportViewer.WebForms

clock August 23, 2011 05:04 by author Jervis

Sometimes I found people post this problem on forum:

Server Error in '/' Application.
--------------------------------------------------------------------------------



Configuration Error



Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.


Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.


Source Error:


Line 24: <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 25: <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
Line 26: <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 27: <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 28: <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />


Source File: C:\inetpub\wwwroot\web.config Line: 26


Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1



Yeah, it’s very disturbing, and we try to find the answer for hours or even days. J

So, this is the steps how to fix this error:

You can install Microsoft Report Viewer 2010 Redistributable or it can be installed from the following location:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\ReportViewer\ReportViewer.exe

Only 3 steps to setup Microsoft Report Viewer 2010 Redistributable:







Done. If you have the problem with your hosting company that cant solve this issue, you can consider our hosting plan. You can always start from our lowest plan, PORTAL ONE. We support the latest asp.net, asp.net mvc 3, web matrix hosting, sql 2008/2008 r2 hosting, etc. You can visit the link for more information.

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 the IE9 Developer Toolbar to Test FireFox

clock August 10, 2011 06:08 by author Jervis

In this brief tutorial, I will show you how to use IE 9 Developer Toolbar to test Firefox. I use a simple web application here with a Button and a Label that display the User Agents when clicked. This is the following code:

protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text = Request.UserAgent;
        }


Run it and you will see the image below:



You need to notice couple of things when you change your browser to IE8:

1. The page automatically reloads (not refresh)
2. The user agent is shown below



To test other browser, open the F12à Developer Toolbar and from Toolsà Change User Agent String



Then try it with Google Chrome



How about Opera?



It is cool, right??

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 :: Fixing Error There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined

clock August 4, 2011 07:14 by author Jervis

I see some people get this error while upgrade from ASP.NET 2.0 to ASP.NET 4.0.

There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined" Error

Solver:

You can visit this link to fix this issue. Good luck. If you have any problem, please let us know.

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 JQuery Make Ajax Call to ASP.NET Server Side

clock August 4, 2011 06:46 by author Jervis

Question:

1. How to call Server Side methods or functions using JavaScript in ASP.NET?
2. How to call Server Side methods Client Side in ASP.NET?

We will show you this tutorial using JQuery to solve this problem. JQuery allows you to call Server Side ASP.NET methods from client side without any PostBack.

Syntax

You can see this figure below:



HTML Markup

<
div>
Your Name :
<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
<input id="btnGetTime" type="button" value="Show Current Time"
    onclick = "ShowCurrentTime()" />
</div>


As you can see, I have added a textbox when user can enter his name and a TML button that calls a JavaScript method to get the Current Time.

Client Side Methods

<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

<script type = "text/javascript">
function ShowCurrentTime() {
    $.ajax({
        type: "POST",
        url: "CS.aspx/GetCurrentTime",
        data: '{name: "' + $("#<%=txtUserName.ClientID%>")[0].value + '" }',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: OnSuccess,
        failure: function(response) {
            alert(response.d);
        }
    });
}
function OnSuccess(response) {
    alert(response.d);
}
</script>

Above the ShowCurrentTime method makes an AJAX call to the server and executes the GetCurrentTime method which accepts the username and returns a string value.

Server Side Methods

C#

[System.Web.Services.WebMethod]
public static string GetCurrentTime(string name)
{
    return "Hello " + name + Environment.NewLine + "The Current Time is: "
        + DateTime.Now.ToString();
}

VB.NET

<System.Web.Services.WebMethod()> _
Public Shared Function GetCurrentTime(ByVal name As String) As String
   Return "Hello " & name & Environment.NewLine & "The Current Time is: " & _
            DateTime.Now.ToString()
End Function

The above method simply returns a greeting message to the user along with the current server time. An important thing to note is that the method is declared as static (C#) and Shared(VB.Net) and also it is declared as Web Method unless you do this you won’t be able to call the methods.

Hope the above tutorial help you to answer the question above. 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 :: ASP.NET File Upload Control

clock August 1, 2011 06:35 by author Jervis

The asp.net FileUpload control allows a user to browse and upload files to the web server. From developers perspective, it is as simple as dragging and dropping the FileUpload control to the aspx page. An extra control, like a Button control, or some other control is needed, to actually save the file.

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="B1" runat="server" Text="Save" OnClick="B1_Click" />

By default, the FileUpload control allows a maximum of 4MB file to be uploaded and the execution timeout is 110 seconds. These properties can be changed from within the web.config file’s httpRuntime section. The maxRequestLength property determines the maximum file size that can be uploaded. The executionTimeout property determines the maximum time for execution.

<httpRuntime maxRequestLength="8192" executionTimeout="220"/>

From code behind, the mime type, size of the file, file name and the extension of the file can be obtained. The maximum file size that can be uploaded can be obtained and modified using the System.Web.Configuration.HttpRuntimeSection class.

Files can be alternatively saved using the System.IO.HttpFileCollection class. This collection class can be populated using the Request.Files property. The collection contains HttpPostedFile class which contains a reference to the class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Configuration;
using System.Web.Configuration;  

namespace WebApplication1
{
    public partial class WebControls : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }  

        //Using FileUpload control to upload and save files
        protected void B1_Click(object sender, EventArgs e)
        {
            if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength >
0)

            {
                //mime type of the uploaded file
                string mimeType = FileUpload1.PostedFile.ContentType;
 
                //size of the uploaded file
                int size = FileUpload1.PostedFile.ContentLength; // bytes  

                //extension of the uploaded file
                string extension = System.IO.Path.GetExtension(FileUpload1.FileName);                 

                //save file
                string path = Server.MapPath("path");                
                FileUpload1.SaveAs(path + FileUpload1.FileName);                 

            }
            //maximum file size allowed
            HttpRuntimeSection rt = new HttpRuntimeSection();
            rt.MaxRequestLength = rt.MaxRequestLength * 2;
            int length = rt.MaxRequestLength;        

            //execution timeout
            TimeSpan ts = rt.ExecutionTimeout;
            double secomds = ts.TotalSeconds;  

        }  

        //Using Request.Files to save files
        private void AltSaveFile()
        {
            HttpFileCollection coll = Request.Files;
            for (int i = 0; i < coll.Count; i++)
            {
                HttpPostedFile file = coll[i];  

                if (file.ContentLength > 0)
                    ;//do something
            }
        }
    }
}

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 :: 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.



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