deploy asp.net app in asphostportal.com server

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
irmeysam
Posts: 1
Joined: May 25th, 2015, 8:57 pm

deploy asp.net app in asphostportal.com server

Post by irmeysam »

I have http://asphostportal.com hosting plan in which multiple domains can be created. In one such domain (not primary) I have hosting my .net app. I am getting error 500
In the web.config file I have included

Code: Select all

<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>



this is my web.config file<connectionStrings>

Code: Select all

<add name="conn" connectionString=" Server=xxx.db.xxxx.hostedresource.com; Database=xxx; User ID=xxx; Password=xxx; Trusted_Connection=False" providerName="System.Data.SqlClient" /> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString=" Server=xxx.db.xxxx.hostedresource.com; Database=xxx; User ID=xxx; Password=xxx; Trusted_Connection=False" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <configuration>
    <system.webServer>
    <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
    </system.web>
    </configuration>


Code: Select all

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
   
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table style="position: relative">
                <tr>
                    <td style="width: 100px">
                    </td>
                    <td style="width: 100px">
                    </td>
                    <td style="width: 100px">
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        <asp:TextBox ID="TextBox1" runat="server" Style="position: relative"></asp:TextBox></td>
                    <td style="width: 100px">
                        <asp:TextBox ID="TextBox2" runat="server" Style="position: relative"></asp:TextBox></td>
                    <td style="width: 100px">
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="position: relative"
                            Text="Button" /></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                    </td>
                    <td style="width: 100px">
                    </td>
                    <td style="width: 100px">
                    </td>
                </tr>
            </table>
   
        </div>
        </form>
    </body>
    </html>


codebehind


Code: Select all

using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
   
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string aa = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
            SqlConnection con = new SqlConnection(aa);
            con.Open();
            string name = TextBox1.Text;
            string pwd = TextBox2.Text;
   
            string str = "insert into login values('" + name + "', '" + pwd + "', '" + pwd + "', '" + pwd + "')";
            SqlCommand cmd = new SqlCommand(str, con);
   
            cmd .ExecuteNonQuery ();
   
   
        }
    }
   




All advice is appreciated!
User avatar
jscher2000
Posts: 11762
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: deploy asp.net app in asphostportal.com server

Post by jscher2000 »

I'm not sure there's a lot of ASP.Net expertise here...

Does this error occur only in Firefox or also in other browsers?

Does it occur when you load the page (GET request) or submit a form (POST request)?
Post Reply