الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Server Error in '/' Application

مغلق
بدأه jrahma في 21 أبريل 2006 · 14 رد · 1,081 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

لماذا احصل على خطأ

اقتباس
Server Error in '/' Application

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

عندما أشغل الموقع من على السيرفر بينما كل شيء تمام التمام على جهازي الذي عليه localhost ولا توجد أخطاء أو تحذيرات ؟!!

كيف يمكن معرفة اين المشكلة؟

#2

يوجد خطأ سببه غير معروف, لذلك ومن أجل ظهور الخطأ, عدل السطر التالي في الملف web.config:

<customErrors 
    mode="RemoteOnly" 
    />

إلى

<customErrors 
    mode="Off" 
    />

تم تعديل هذه المشاركة بواسطة إسماعيل عنجريني في 21 أبريل 2006 في 20:57

#3

لازالت المشكلة واللي امجنني ليش الخطأ مايصير إلا على السيرفر بينما على الـ localhost ما في مشكلة.

غيرت الكود إلى

        <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>

تم تعديل هذه المشاركة بواسطة jrahma في 21 أبريل 2006 في 22:45

#5
jrahma كتب:
لازالت المشكلة واللي امجنني ليش الخطأ مايصير إلا على السيرفر بينما على الـ localhost ما في مشكلة.

غيرت الكود إلى

        <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>

إذا لم يظهر الخطأ فهناك احتمال كبير أن يكون الخطأ في نفس ال web.config ، هل يمكن أن تكتب لنا محتويات هذا الملف؟

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

#6

هذا هو رابط الموقع

http://jrahma-1.at.vwdhosting.net/

وهذا هو الملف:

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<appSettings/>
	<connectionStrings/>
	<system.web>
  <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" culture="ar-bh" uiCulture="ar"/>
    
    <compilation debug="true"/>
  <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
  <authentication mode="Windows"/>
  <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="Off" />
        -->
	</system.web>
</configuration>
#7

يظهر الخطأ عند فتح

http://jrahma-1.at.vwdhosting.net/signup.aspx

أكتب محتوى الشفرة

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

#8

السؤال المهم لماذا كل شي عال العال على الـ localhost؟!!

عموماً هذا هوالكود لصفحة signup.aspx

<%@ Page Language="C#" Culture="ar-BH" UICulture="ar-BH" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["member_cpr"] != null)
        {
            if (Session["member_sex"].ToString() == "F") cboSex.Text = "ذكر"; else cboSex.Text = "ذكر";
        }
        
        if (Session["member_cpr"] != null) txtCPR.Text = Session["member_cpr"].ToString();
        if (Session["member_password"] != null) txtPassword.Text = Session["member_password"].ToString();

        if (Session["member_nationality"] != null)
        {
            if (Session["member_nationality"].ToString() == "بحريني") cboNationality.Text = "بحريني"; else cboNationality.Text = "بحريني";
        }
        
        if (Session["member_block"] != null) cboBlock.Text = Session["member_block"].ToString();
        if (Session["member_email"] != null) txtEmail.Text = Session["member_email"].ToString();
        if (Session["member_mobile"] != null) txtMobile.Text = Session["member_mobile"].ToString();
        
        // Create a connection
        // SqlConnection dbConn = new SqlConnection("Provider=SQLOLEDB; Data Source=64.224.17.231; InitialCatalog=global-adjusterscom; User Id=user1169263; Password=qnnkqfabay");
        SqlConnection dbConn = new SqlConnection("Server=xx.xxx.xxx.xxx;uid=xxxxxxxx;password=xxxxxxxxx;database=xxxxx;");
    
        // You must open the connection before populating the DataReader
        dbConn.Open();

        // Create a command object for the query
        SqlCommand dbCmd = new SqlCommand("SELECT block_no, block_name_arabic FROM blocks ORDER BY block_no", dbConn);

        cboBlock.DataSource = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
        cboBlock.DataTextField = "block_no";
        cboBlock.DataValueField = "block_no";
        cboBlock.DataBind();
    
        // TODO: Databind the DataReader to the listbox Web control
    }

    protected void btnRegister_Click(object sender, EventArgs e)
    {
        Session["member_sex"] = cboSex.Text;
        Session["member_cpr"] = txtCPR.Text;
        Session["member_password"] = txtPassword.Text;
        Session["member_nationality"] = cboNationality.Text;
        Session["member_block"] = cboBlock.Text;
        Session["member_email"] = txtEmail.Text;
        Session["member_mobile"] = txtMobile.Text;

        Response.Redirect("confirm_signup.aspx");
    }
</script>

<html dir="rtl" lang="ar-bh" xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link rel="StyleSheet" type="text/css" href="stylesheet.css">
    <title><!--#include file="title.inc"--></title>
</head>
<body dir="rtl" lang="ar-bh" bottommargin="5" leftmargin="5" rightmargin="5" topmargin="5">
    <form id="form1" runat="server">
    <div align="center">
        التسجيل في مركز استطلاع الرأي
        <br /><br />
        <table align="center" dir="rtl" lang="ar-bh" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td align="right">الجنس</td>
                <td>  :  </td>
                <td align="right">
                    <asp:DropDownList ID="cboSex" runat="server" CssClass="normal" Font-Names="Tahoma">
                        <asp:ListItem Value="M">ذكر</asp:ListItem>
                        <asp:ListItem Value="F">أنثى</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td align="right">الرقم الشخصي</td>
                <td>  :  </td>
                <td align="right">
                    <asp:TextBox ID="txtCPR" runat="server" MaxLength="9"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td align="right">كلمة السر</td>
                <td>  :  </td>
                <td align="right"><asp:TextBox ID="txtPassword" runat="server" MaxLength="25"></asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td align="right">الجنسية</td>
                <td>  :  </td>
                <td align="right">
                    <asp:DropDownList ID="cboNationality" runat="server" CssClass="normal" Font-Names="Tahoma">
                        <asp:ListItem Value="Y">بحريني</asp:ListItem>
                        <asp:ListItem Value="N">غير بحريني</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td align="right">المجمع</td>
                <td>  :  </td>
                <td align="right">
                    <asp:DropDownList ID="cboBlock" runat="server" CssClass="normal" Font-Names="Tahoma">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td align="right">البريد الالكتروني</td>
                <td>  :  </td>
                <td align="right"><asp:TextBox ID="txtEmail" runat="server" MaxLength="200"></asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td align="right">الهاتف النقال</td>
                <td>  :  </td>
                <td align="right"><asp:TextBox ID="txtMobile" runat="server" MaxLength="8"></asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td><strong><span style="color: red">ملاحظة هامة :</span></strong></td>
                <td></td>
                <td align="right"><strong>يرجى التأكد من البيانات التي أدخلتها<br />لأنه لا يمكن تعديل بعضها لاحقاً</strong></td>
            </tr>
            <tr>
                <td></td>
                <td><br /></td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td><asp:Button ID="btnRegister" runat="server" Text="اشترك الآن" CssClass="normal" OnClick="btnRegister_Click" /></td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
#9
اقتباس
    // SqlConnection dbConn = new SqlConnection("Provider=SQLOLEDB; Data Source=64.224.17.231; InitialCatalog=global-adjusterscom; User Id=user1169263; Password=qnnkqfabay");

      SqlConnection dbConn = new SqlConnection("Server=xx.xxx.xxx.xxx;uid=xxxxxxxx;password=xxxxxxxxx;database=xxxxx;");

 

      // You must open the connection before populating the DataReader

      dbConn.Open();

1) تأكد من أن ال connectionstring صحيح،،،

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

#10

الـ connectionstring صحيح مئة بالمئة

لأني عندما أقول أنها تعمل على الـ localhost لكن الـ connectionstring هو نفسه

#11

عزيزي،

قم بإزالة الشفرة الخاصة بالتعامل مع قاعدة البيانات وجرب.

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

#12

يا ربي!!!

فتحت الصفحة.. يمكنك رؤيتها في الرابط المذكور

http://jrahma-1.at.vwdhosting.net/

ولكن أين المشكلة؟

ولماذا نفس اكود يعمل على localhost

#13
jrahma كتب:
يا ربي!!!

فتحت الصفحة.. يمكنك رؤيتها في الرابط المذكور

http://jrahma-1.at.vwdhosting.net/

ولكن أين المشكلة؟

ولماذا نفس اكود يعمل على localhost

شايف :)

أنا أجزم الآن أن هناك خطأ في ال connectionstring ،

هل قمت بإنشاء قاعدة البيانات في مخدم الإستضافة؟؟ هل أشنأت المستخدمين؟ هل قرأت ال Knowledge base الخاص بالشركة المستضيفة عن كيفية الإتصال بقاعدة البيانات؟

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

#14

أولاً:

قاعدة البيانات موجودة على سيرفر

والملفات موجودة على سيرفر آخر

ثانياً: عندما أشغل الصفحة من localhost أستخدم نفس الـ connectionstring أي أن الملفات أشغلها من الجهاز لكنها تفتح قاعدة بيانات موجودة على سيرفر ولا يوجد أي مشكلة نهائياً

#15

الآن وصلنا لنقطة كنت أريد أن أنوه عليها من قبل،

يبدو أن هذه العملية خارج صلاحيات ال Medium trust ، يعني أن المستضيف الحالي المجاني لن يخدمك في تشغيل الموقع لاحتياجه لل Full trust ،

قم بالإستفسار عن الخطأ عن طريق مراسلتهم، طبعا رجع شفرة الخطأ، من خلال المخدم لو فتحو الموقع حيعطوك الخطأ بالضبط.

بالتوفيق

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

هذا الموضوع مغلق.

مواضيع مشابهة