Click here to Skip to main content
15,905,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

i have a problem in my Asp.net form , when i start to debug the code this message appears :

Error 100 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

Error 101 The type or namespace name 'DataAnnotations' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)

and also any other Asp.net Control Objects(textbox,dropdownlist,..)are not recognized either in code page and in Html page:
Error 102 The name 'personlCodeTextBox' does not exist in the current context

Error 103 The name 'SerialNumTextBox' does not exist in the current context
Error 104 The name 'nationalNumTextBox' does not exist in the current context
Error 105 The name 'PassNumTextBox0' does not exist in the current context


meanwhile my form is located in a master page.


and this is my code:
ASP.NET
<%@ Page Title="" Language="C#" MasterPageFile="~/Page1.Master" AutoEventWireup="true" CodeBehind="~/GeneralInfo.aspx.cs" Inherits="Marashi.GeneralInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <style type="text/css">
        .style1
        {
            height: 26px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form action="GeneralInfo.aspx" method="post" id="Form1">
  <div id="div1" dir="rtl"  runat="server">
     <asp:ScriptManager EnableHistory="true" ID="ScriptManager1" runat="server"></asp:ScriptManager>
          <asp:UpdatePanel UpdateMode="Always" ID="UpdatPanel1" runat="server">
             <ContentTemplate>

                 <table style="width:100% ; overflow:hidden;table-layout:fixed" >
                     <tr>
                         <td class="style1" dir="rtl" height="35">
                             </td>
                         <td class="style1" dir="rtl" height="35">
                             </td>
                         <td class="style1" dir="rtl" height="35">
                             </td>
                         <td class="style1" dir="rtl" height="35">
                             </td>
                         <td class="style1" dir="rtl" height="35">
                             </td>
                         <td class="style1" dir="rtl" height="35">
                             </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label1" runat="server" Text="نام :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="FirstNameTextBox" runat="server" 
                                 Text='<%# Bind("FirstName", "{0}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label2" runat="server" Text="نام خانوادگی :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="LastNameTextBox" runat="server" 
                                 Text='<%# Bind("LastName", "{0}") %>' Width="145px" ></asp:TextBox>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label3" runat="server" Text="نام پدر :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="FatherNameTextBox" runat="server" 
                                 Text='<%# Bind("FatherName", "{0}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label4" runat="server" Text="شماره پرسنلی :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="personlCodeTextBox" runat="server" 
                                 Text='<%# Bind("PersonelCode", "{0:N}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                             <asp:RangeValidator ID="RangeValidator2" runat="server" 
                                 ControlToValidate="personlCodeTextBox" ErrorMessage="RangeValidator" 
                                 MaximumValue="4" MinimumValue="0" Type="Integer"></asp:RangeValidator>
                         </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label5" runat="server" Text="کشور محل تولد :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:DropDownList ID="CountryDrpDown" runat="server" Width="145px" AutoPostBack="true">
                             </asp:DropDownList>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label6" runat="server" Text="شهر محل تولد :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:DropDownList ID="CityDrpDown" runat="server" Width="145px" AutoPostBack="true">
                             </asp:DropDownList>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label7" runat="server" Text="محل صدور شناسنامه :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:DropDownList ID="SodorCityDrpDown" runat="server" Width="145px" AutoPostBack="true">
                             </asp:DropDownList>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label8" runat="server" Text="شماره شناسنامه :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="SerialNumTextBox" runat="server" 
                                 Text='<%# Bind("SerialNumber", "{0:N}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label9" runat="server" Text="شماره ملی :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="nationalNumTextBox" runat="server" 
                                 Text='<%# Bind("NationalNumber", "{0:N}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label22" runat="server" Text="تاریخ تولد :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="BirthDateTextBox" runat="server" 
                                 Text='<%# Bind("BirthDate_S", "{0:d}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label11" runat="server" Text="جنسیت :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:RadioButtonList ID="GendeRadioBtn" runat="server" selectedIndex='<%#Bind("Gender") %>'
                             selectedValue='<%#Bind("Gender")%>' RepeatDirection="Horizontal" AutoPostBack="true" >
                             <asp:ListItem Selected="True">مرد</asp:ListItem>
                             <asp:ListItem>زن</asp:ListItem>
                             </asp:RadioButtonList></td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label10" runat="server" Text="شماره گذرنامه :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="PassNumTextBox0" runat="server" 
                                 Text='<%# Bind("PassportNumber", "{0:N}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label13" runat="server" Text="نظام وظیفه :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:DropDownList ID="DropDownMilitary" runat="server" 
                                 AppendDataBoundItems="True" AutoPostBack="True" 
                                 SelectedValue='<%# Bind("MilitaryStatusId", "{0}") %>' Width="100px">
                                 <asp:ListItem>انجام داده ام </asp:ListItem>
                                 <asp:ListItem>در حال خدمت </asp:ListItem>
                                 <asp:ListItem>معافیت دائم</asp:ListItem>
                                 <asp:ListItem>معافیت موقت </asp:ListItem>
                             </asp:DropDownList>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label12" runat="server" Text="وضعیت تأهل :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:RadioButtonList ID="MaryRadio" runat="server" 
                                 RepeatDirection="Horizontal" 
                                 SelectedValue='<%# Bind("MaritalStatus", "{0}") %>'>
                                 <asp:ListItem>مجرد</asp:ListItem>
                                 <asp:ListItem>متأهل</asp:ListItem>
                             </asp:RadioButtonList>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label14" runat="server" Text="تابعیت :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="NationalityTextBox" runat="server" 
                                 Text='<%# Bind("Nationality", "{0}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label17" runat="server" Text="تلفن ثابت :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="PhoneTextBox0" runat="server" 
                                 Text='<%# Bind("Phone") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label18" runat="server" Text="تلفن همراه :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="MobileTextBox1" runat="server" 
                                 Text='<%# Bind("Mobile") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label20" runat="server" Text="کد پستی :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="PostalCodeTextBox" runat="server" 
                                 Text='<%# Bind("PostalCode", "{0:N}") %>' Width="145px"></asp:TextBox>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label19" runat="server" Text="رایانامه :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35">
                             <asp:TextBox ID="EmailTextBox1" runat="server" 
                                 Text='<%# Bind("Email", "{0}") %>' Width="145px" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                             <asp:Label ID="Label21" runat="server" Text="آدرس منزل :"></asp:Label>
                         </td>
                         <td dir="rtl" height="35" colspan="3">
                             <asp:TextBox ID="AddressTextBox" runat="server" 
                                 Text='<%# Bind("HomeAddress", "{0}") %>' Width="545px"></asp:TextBox>
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                             <asp:Button ID="Button1" runat="server" onclick="SubmitButton" Text="Button" />
                         </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                     <tr>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                         <td dir="rtl" height="35">
                              </td>
                     </tr>
                 </table>

             </ContentTemplate>
          </asp:UpdatePanel>

  </div>
</form> 
</asp:Content>
Posted
Updated 28-Jul-12 20:08pm
v2

1 solution

You need to post code, we need to see what line has this error. There is a global.asax. but not a global_asax class.
 
Share this answer
 
Comments
mohammad ehsan 29-Jul-12 2:08am    
i posted my code.
Christian Graus 29-Jul-12 2:10am    
And what line has the error ?
mohammad ehsan 29-Jul-12 2:18am    
in the first line the Error 100 ,Error 101 appears. and also in my C# code can not recognize all of Object Controls that i have creatd them .
Christian Graus 29-Jul-12 2:27am    
If I were you, I'd remove all this code and add it back bit by bit. I think there's an error in there that is confusing it completely.
mohammad ehsan 29-Jul-12 2:32am    
let me add this point that it was working until yesterday , and didn't have any problem, but sometimes (even now)object controls are recognized by .net but after a while it doesn't recognize it.for example now , i don't know what has happaned that all errors such as these errors has removed :

Error 102 The name 'personlCodeTextBox' does not exist in the current context
Error 103 The name 'SerialNumTextBox' does not exist in the current context Error 104 The name 'nationalNumTextBox' does not exist in the current context Error 105 The name 'PassNumTextBox0' does not exist in the current context
but still this two errors has remained:

Error 100 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?) Error 101 The type or namespace name 'DataAnnotations' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900