Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 222683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:09:01+00:00 2026-05-11T19:09:01+00:00

I am working on a mobile.net project. I am trying to make a list

  • 0

I am working on a mobile.net project.
I am trying to make a list of restaurants which is displayed in a drop down list…whn d user selects an item he can add it to d list of favorites.
However I am getting an error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0102: The type 'mobile_rest' already contains a definition for 'emptyChangingEventArgs'

Source Error:

Line 78: {
Line 79:    
Line 80:    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
Line 81:    
Line 82:    private int _r_id;

I have no clue why this is happening…
is it because i used d same table in another file too?

Here is my code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Favorite.aspx.cs" Inherits="Favorite" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:Form id="Form1" runat="server" BackColor="#fcf9f3" Method="get" Paginate="True">

        <mobile:Label ID="FaveError" Runat="server" ForeColor="red" 
            Font-Size="Small" Font-Bold="True" Visible="false" />

        <mobile:Label ID="Label2" Runat="server" ForeColor="#d3af63" Font-Italic="True" 
                Font-Name="Monotype Covasia" Font-Bold="True" text="Choose Favorite's" />

        <mobile:SelectionList ID="listSearch" Runat="server" DataTextfield="r_name"
                 DataValueField="r_name" BreakAfter="False">

        </mobile:SelectionList>

        <mobile:Command ID="btnadd" text="Add" Runat="server" OnClick="btn_add_Click" />

        <mobile:list runat="server" id="ListFavorite" DataTextfield="fave_name"
             DataValueField="user_id" Font-Size="Small" Font-Italic="True" 
             Wrapping="Wrap"  BreakAfter="True"/>
            <mobile:Command ID="btndelete" text="Delete" Runat="server" OnClick="btn_delete_Click" />

    </mobile:Form>
</body>
</html>

And code behind

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Data.Linq;
using System.Xml.Linq;
using System.Linq;

public partial class Favorite : System.Web.UI.MobileControls.MobilePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["error_msg"] != null)
        {
            FaveError.Text = Session["error_msg"].ToString();
            Session["error_msg"] = null;
            FaveError.Visible = true;
        }

        //if (Session["user_id"] = null)
        //{
        //    Response.Redirect("Login.aspx");
        //}
        GetRstr();
        GetFave();
    }

    protected void btn_add_Click(object sender, EventArgs e)
    {
        if (Page.IsValid) // only valid page will proceed
        {
            AddFave();
        }
    }

    #region add fave
    protected void AddFave()
    {
        String faveitem = listSearch.SelectedIndex;

        using (FavoriteDataContext Favorite = new FavoriteDataContext())
        {
            mobile_favorite mobilefave = new mobile_favorite();
            mobilefave.fave_name = faveitem;
            mobilefave.user_id = Int32.Parse(Session["user_id"].ToString());
            mobilefave.username = Session["user_name"].ToString();

            Favorite.mobile_favorites.InsertOnSubmit(mobilefave);
            Favorite.SubmitChanges();

            Session["error_msg"] = "You have a new favorite";
            Response.Redirect("Favorite.aspx");
        }
    }
    #endregion


    protected void btn_delete_Click(object sender, EventArgs e)
    {
        if (Page.IsValid) // only valid page will proceed
        {
            DeleteFave();
        }
    }

    #region del fave
    protected void DeleteFave()
        {
            int iuser_id = Int32.Parse(Session["user_id"].ToString());
            using (FavoriteDataContext Favorite = new FavoriteDataContext())
            {
                try
                {
                    mobile_favorite fave = Favorite.mobile_favorites.Single(f => f.user_id == iuser_id);

                    Favorite.mobile_favorites.DeleteOnSubmit(fave);
                    Favorite.SubmitChanges();
                }
                catch (Exception ex)
                {
                }
            }
        }
    #endregion


    protected void GetFave()
    {
        using (FavoriteDataContext Favorite = new FavoriteDataContext())
        {
            var fave = from f in Favorite.mobile_favorites
                      // where f.user_id == Int32.Parse(Session["user_id"].ToString())
                       select f;

            ListFavorite.DataSource = fave;
            ListFavorite.DataBind();
        }
    }

    protected void GetRstr()
    {
        using (Restaurant2DataContext Restaurant2 = new Restaurant2DataContext())
        {
            var rstr = from r in Restaurant2.table_rests
                       select r;

            listSearch.DataSource = rstr;
            listSearch.DataBind();
        }
    }
}

mobile_rest is the table name

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:09:01+00:00Added an answer on May 11, 2026 at 7:09 pm

    If “mobile_rest” is a database table name and you’re using the standard VS2008 tools to create your LINQ-based classes, then I guess you’ve also got a partial class also named “mobile_rest.” Do you accidentally have this type declaring emptyChangingEventArgs in multiple places? Just use the search functionality within VS and see how many times this static field is declared.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm working on windows mobile app (c#, .net 2.0). i would like to make
I'm working with C#.net developing applications for windows mobile 6, and i need get
I'm working on a project where a program running on the mobile phone needs
Working in .NET Compact Framework, C#, .Net 3.5, Visual Studio 2008. Targeting Windows Mobile
Right now I am working with my first Windows Mobile project and I have
I am working on a mobile application in .NET. This is a windows mobile
I am working on a mobile application on .net. This is a windows mobile
I'm working on an ASP.NET website which targets desktop browsers. We want to enable
I am working on a .net project, (first ever for me) and I would
I am currently working on a Mobile App project for Ford company, and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.