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 8033289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:39:07+00:00 2026-06-05T01:39:07+00:00

Problem is: I want to run 3 different actions but instead of that i

  • 0

Problem is: I want to run 3 different actions but instead of that i want to fed all data from single action in a bigger model.

I am using:

public class SearchScrapClass
    {
        public WClass WClass { get; set; }
        public SClass SClass { get; set; }
        public YClass YClass { get; set; }
    }

    public class WClass 
    {
        public string title { get; set; }
        public string link { get; set; }
    }
    public class SClass 
    {
        public string title { get; set; }
        public string link { get; set; }
    }
    public class YClass 
    {
        public string title { get; set; }
        public string link { get; set; }
    }

I am using LINQ to add data in these models.

I am using :

      var wikians = from info in document.DocumentNode.SelectNodes("//div[@id='span']")
        from link in info.SelectNodes("div//a").Where(x => x.Attributes.Contains("href"))
         select new SearchScrapClass //Main Bigger Class
         {
            WClass.link= link.Attributes["href"].Value, //ERROR: How to add to WClass's url ?
            WClass.title= link.InnerText //ERROR: How to add to WClass's url ?
         }


var wikians = from info in document.DocumentNode.SelectNodes("//div[@id='results']")
               from link in info.SelectNodes("p//a").Where(x => x.Attributes.Contains("href"))
               select new SearchScrapClass //Main Bigger Class
                 {
                   YClass.link= link.Attributes["href"].Value, //ERROR: How to add to YClass's url ?
                   YClass.title= link.InnerText //ERROR: How to add to YClass's url ?
                 }

//Also for the 3rd class (model)


    return View(wikians); //and then return bigger class model so that i can access them in view

This is one way i want to add data to link and title of all the classes.

My try is to add data to all 3 classes from different sources and pass the bigger model to view so that i can access all the classes as:

@model SearchScrapClass
@using(Html.BeginForm()) {
    @Html.EditorFor(o => o.WClass.link)
    ...
}

Please suggest a way

Thanks

  • 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-06-05T01:39:08+00:00Added an answer on June 5, 2026 at 1:39 am

    To Expand on my comment, I would suggest creating a ViewModel folder for organization sake. in this add the view model

    public class SearchScrapClassViewModel
    {
        SearchScrapClass searchScrap;
        WClass wClass;
        SClass sClass;
        YClass yClass;
    }
    

    In your controller then you instantiate the new viewmodel

    SearchScrapClassViewModel model = new SearchScrapClassViewModel
    {
        ....add in your logic to fill your class objects here
    
    
    }
    
    return view(model);
    

    then in your view add the using for the viewmodel.

    @using SearchScrapClassViewModel
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run my function in a different thread but the problem is
I have the following code I want to run, but the problem is $this->type
I have problem with fancybox. I want to write a function that will run
We are working on integrating two different applications that run simultaneously and share data.
I run into this problem. I have a textarea which I only want to
I want to Scan QR codes on button Click, problem is when I run
Problem: I want to list n number of games from each genre (order not
Problem I want to create an application that can be extended somehow by programmers.
So I have two html buttons that each run a different function (both functions
I have a problem. I want to run the scipy.stats f_oneway() ANOVA in a

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.