Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

Tutorial and Articles about Windows Hosting, SQL Hosting, MVC Hosting, and Silverlight Hosting

Windows Hosting - ASPHostPortal.com :: Web Services with ASP.NET

clock July 25, 2016 20:35 by author Armend

Web Services with ASP.NET

A Web Service is programmable application logic accessible via standard Web protocols. One of these Web protocols is the Simple Object Access Protocol (SOAP). SOAP is a W3C submitted note (as of May 2000) that uses standards based technologies (XML for data description and HTTP for transport) to encode and transmit application data.
Consumers of a Web Service do not need to know anything about the platform, object model, or programming language used to implement the service; they only need to understand how to send and receive SOAP messages (HTTP and XML).

 

Soap Message

A SOAP message consists of several elements, most notably an envelope. The envelope encapsulates the data transmitted within the SOAP message. Below is a simple SOAP message complete with HTTP headers:

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
               xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  <soap:Body>
    <PerfCounters xmlns="http://tempuri.org/"/>
  </soap:Body>
</soap:Envelope>

In the example above, we see the HTTP headers for the request, including the HTTP SOAPAction header, which is optionally used by the server for routing the SOAP message. Following the HTTP headers we find the body of the HTTP message. The body of the HTTP message is the SOAP request for a PerfCounters Web Service, which we are going to build.

Best Windows Server 2008 Hosting Recommendation

ASPHostPortal.com

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

 



ASP.NET Hosting - ASPHostPortal.com :: How To Configuring your .NET application to use the ASP.NET Session State Store Provider

clock June 27, 2016 19:55 by author Armend

How To Configuring your .NET application to use the ASP.NET Session State Store Provider

In this post I will show you how to configure the ASP.NET session state store provider, you must update the web.config file for the ASP.NET application to include the ASP.NET session state store provider and its configuration.

Before you begin

  • Configure a data grid to store ASP.NET HTTP session state.
  • You must have the catalog server host and port.

Procedure

Update the web.config file of your ASP.NET application with settings for the ASP.NET session state store provider. You must update or add the text in bold in the following example to the web.config file

<system.web>
    …
    <sessionState
        mode="Custom"
        customProvider="WxsSessionStateStoreProvider">
        <providers>
                <add
                     name="WxsSessionStateStoreProvider"
                    type="IBM.WebSphere.Caching.SessionStateStore.WxsSessionStateStore,
                        IBM.WebSphere.Caching, Version=8.6.0.2000, Culture=neutral,
                        PublicKeyToken=b439a24ee43b0816"
                    wxsPropertyFile="\optional\path\to\NET-client.properties"
                    wxsHostAndPort="optionalHostAndPort"
                    wxsGridName="session"
                    wxsMapName="ASPNET.SessionState"
         />          
        </providers>
        </sessionState>
    …
</system.web>

wxsPropertyFile (optional)Specifies the fully qualified properties file that the provider uses when it connects to the data grid with the Connect API. If this attribute is not specified or is an empty string, the provider looks for the Client.Net.properties file in the current runtime directory of the web application process. If the provider does not find the file in the runtime directory, it looks for the Client.Net.properties file in the net_client_home\config directory.wxsHostAndPort (optional)Specifies a comma-separated list of catalog server host and port pairs to which the session state store provider connects when it accesses the data grid. The format follows:

<host name or host ip address>:<tcp port>[,<host name or host ip address>:<tcp port>]

If no value is specified, localhost:2809 is used.

wxsGridName (optional)

Specifies the name of the data grid to which the ASP.NET session store provider connects. If you created a data grid for ASP.NET session states, specify the data grid name that you created. If you do not specify a value, the provider connects to the session data grid.

wxsMapName (optional)

Specifies the map to which the provider connects. If you do not specify a value, the provider connects to the ASPNET.SessionState map.

  • Restart the target web application. The web application must restart so that the provider can be loaded by IIS. In most cases, after the web.config file is modified and current HTTP request processing is complete, the restart occurs automatically.

Results

ASP.NET session state from your ASP.NET application is stored in the data grid.



ASP.NET Hosting - ASPHostPortal.com :: How to Fix ASP.NET Browser Detection Error in Internet Explorer

clock June 20, 2016 20:50 by author Armend

Internet Explorer 11 has a bug which prevents ASP.NET applications from running properly. Your users will view broken layout and JavaScript errors, which occurs due to a bug in the browser detection under .NET Framework 4.

You can easily track down the browser detection problem by using F12 development tool available with Internet Explorer, which modifies the user-agent string sent by the browser. In order to work with the tool, you need to press F12, click the Emulation button located at the bottom left and choosing Internet Explorer 9 from the dropdown list. You will be able to see whether the page renders properly immediately after page refresh.

In order to fix the above issue, you need to install .NET Framework 4.5 on the server, which has built-in solution for this problem. However, if you are running Windows 2003 Server then you will have to install patches provided by Microsoft to update browser detection problem in older versions of .NET Framework. Alternatively, you can directly update the application by opening the App_Browsers folder and adding a .browser file with correct definitions as shown below.

<browsers>
  <browser id="IE11" parentID="Mozilla">
    <identification>
      <userAgent match="Trident/(?'layoutVersion'[7-9]|0*[1-9]\d+)(\.\d+)?;(.*;)?\s*rv:(?'version'(?'major'\d+)(\.

(?'minor'\d+)))" />
      <userAgent nonMatch="IEMobile" />
    </identification>
    <capture>
      <userAgent match="Trident/(?'layoutVersion'\d+)" />
    </capture>
    <capabilities>
      <capability name="browser"              value="IE" />
      <capability name="layoutEngine"         value="Trident" />
      <capability name="layoutEngineVersion"  value="${layoutVersion}" />
      <capability name="extra"                value="${extra}" />
      <capability name="isColor"              value="true" />
      <capability name="letters"              value="${letters}" />
      <capability name="majorversion"         value="${major}" />
      <capability name="minorversion"         value="${minor}" />
      <capability name="screenBitDepth"       value="8" />
      <capability name="type"                 value="IE${major}" />
      <capability name="version"              value="${version}" />
    </capabilities>
  </browser>
 
  <!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11,0) like Gecko -->
  <browser id="IE110" parentID="IE11">
    <identification>
      <capability name="majorversion" match="11" />
    </identification>
 
    <capabilities>
      <capability name="ecmascriptversion"    value="3.0" />
      <capability name="jscriptversion"       value="5.6" />
      <capability name="javascript"           value="true" />
      <capability name="javascriptversion"    value="1.5" />
      <capability name="msdomversion"         value="${majorversion}.${minorversion}" />
      <capability name="w3cdomversion"        value="1.0" />
      <capability name="ExchangeOmaSupported" value="true" />
      <capability name="activexcontrols"      value="true" />

I hope this article helpful for you. happy coding :)

ASPHostPortal.com

ASPHostPortal.com provides quality and reliable ASP.NET 5 hosting services at affordable prices. We are guarantee 99.9% uptime for your site. We have three available payment methods: PayPal, Visa and American Express, so you can pay for their services from all around the world.



ASP.NET Hosting - ASPHostPortal.com :: Adding Facebook Share Functionality to an ASP.NET Website with a Master Page

clock April 4, 2016 23:13 by author Armend

This article assumes the reader has experience developing web sites using ASP.NET, specifically using Master Pages. It also assumes a familiarity with Facebook. All sample code is in C#. After reading this article, you should be able to integrate Facebook Share with an ASP.NET web site, whether or not it contains a Master Page. I've chosen to illustrate this using a Master Page because it's a little more involved, and once you can do it with a Master Page, you should be able to do it without one as well.

 

What is Facebook Share, and how does it work?

First, let's review what Facebook Share actually is. Adding a Share widget to a web page allows a user to click on an icon which launches a Facebook Share dialog. If the user has a Facebook account, they can then share the web page on their Facebook "wall" with their friends on Facebook, adding comments if they so choose. Their friends will have the opportunity to share with their friends, and so on. In this way, a web page's exposure can increase dramatically in a very short time.
According to the Facebook web site's documentation there are five steps you need to take in order to integrate Share with a web page:

Step 1: Add a link to the Facebook Share application hosted by Facebook:

<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a>

Step 2: Add a script tag that points to a Javascript component hosted by Facebook:

<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

Step 3: Add a meta tag containing the title of the page:

<meta name="title" content="This is the Title" />

Step 4: Add a meta tag containing a description of the page:

<meta name="description" content="This is a short summary of the page." />

Step 5: Add a link tag pointing to an image to be used as a logo:

<link rel="image_src" href="http://www.murrayhilltech.com/images/LogoColorNoText.jpg" />

The Problem

All well and good, but we were talking about doing this while using a Master Page. See the problem yet? Well, if all the pages in our site use a common Master Page, which presumably contains the head tag, which in turn contains all the meta tags and link tags, how do we specify different tag values for different pages? Therein lies the problem. The solution lies in the code-behind file.

The Solution

I've chosen to place the code for Steps 1 and 2 in the actual web page as opposed to the Master Page, since that will allow us the flexibility to place the Share widget in varying locations on each page should we care to do so. However, I'm going to accomplish this by inserting an empty asp:Label component in the desired location in the aspx file, and assigning the appropriate value to it in the Page_Load event in the code-behind file. I'm going to use the same asp:Label component to hold the code for both Steps 1 and 2:

// This code for the asp:Label component goes in the aspx file
<asp:Label ID="labelSteps_1_2" runat="server" Text=""></asp:Label>
// The code to populate the asp:Label component with the html and script code
// for Steps 1 and 2 should go in the code-behind file
labelSteps_1_2.Text = "<a name=\"fb_share\" type=\"button\"></a>" +
"<script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" " +
"type=\"text/javascript\"></script>";

Next, we'll instantiate a couple of HtmlMeta objects to handle the meta tags in Steps 3 and 4, also in the Page_Load event:

HtmlMeta tag = new HtmlMeta();
tag.Name = "title";
tag.Content = "This is the Title";
Page.Header.Controls.Add(tag);
HtmlMeta tag = new HtmlMeta();
tag.Name = "description";
tag.Content = "This is a short summary of the page.";
Page.Header.Controls.Add(tag);
Finally, we'll add the logo in Step 5 in the same Page_Load event using an HtmlLink object:
 HtmlLink link = new HtmlLink();
link.href="http://www.murrayhilltech.com/images/LogoColorNoText.jpg";
link.Attributes["rel"] = "image_src";
Page.Header.Controls.Add(link);

Creating these elements dynamically in the code-behind file allows us to add them to the head element of the Master Page without ever actually modifying the Master Page. You can use this same method for pages and/or sites that don't make use of Master Pages.

Putting It All Together

The complete listing for the code-behind file is shown below. The only other change we made was to add that asp:Label control to the aspx file. Here's the code behind file:

using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
namespace MHT_Web_Site
{
public partial class MyPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
labelSteps_1_2.Text = "<a name=\"fb_share\" type=\"button\"></a>" +
"<script " +
"src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" " +
"type=\"text/javascript\"></script>";
HtmlMeta tag = new HtmlMeta();
tag.Name = "title";
tag.Content = "This is the Title";
Page.Header.Controls.Add(tag);
HtmlMeta tag = new HtmlMeta();
tag.Name = "description";
tag.Content = "This is a short summary of the page.";
Page.Header.Controls.Add(tag);
HtmlLink link = new HtmlLink();
link.href="http://www.murrayhilltech.com/images/LogoColorNoText.jpg";
link.Attributes["rel"] = "image_src";
Page.Header.Controls.Add(link);
}
catch (Exception ex)
{
// Handle the exception
}
}
}
}

I hope that this article helps you get started integrating Facebook with ASP.NET web sites. For more information, check Facebook's web site. The documentation there is not organized very well, but it's there if you dig for it.

 



ASP.NET Hosting - ASPHostPortal.com :: SEO Tips For ASP.NET URL’s

clock March 14, 2016 20:37 by author Armend

If you are building a new ASP.NET application, SEO has become a big factor in how you plan the structure / code of the site.  But quite an important part of the site which are often overlooked are the URL’s, and a lot of people do the basics which I’ll show below but there are a few common things people tend to miss or never thought could be a problem. I use ISAPI rewrite for most of my sites, which is an amazingly effective tool for sorting duplicate content and SEO issues which I’ll show below

 

  • Rewrite your URL’s to be useful / descriptive and stick away from using the old dynamic way

i.e. mypage.aspx?e=54&b=99
Google even tell you this is not ideal in the webmaster guidelines (See bottom of Design & Content Guidelines section) - http://www.google.co.uk/support/webmasters/bin/answer.py?answer=35769&hlrm=en_uk More...



About ASPHostPortal.com

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

Sign in