locked
Loud similar item when selecting an item RRS feed

  • Question

  • User1860059286 posted

    Hello

    I'm trying to built in my web site the possibility to loud equal fields in the "select" page

    (when the user select item , I would like items that are related data  in the "name column"

    Will be fire hopefully I'm clear  )

    That I have tried doing was in my repository I have written:

     public UserVideoLec GetWithAttach(int id, string name)
            {
                return (from s in _entity.UserVideoLecs
                        where s.Id == id
                        && s.Name == name
                        select s).FirstOrDefault();
                        
            }
    

    (I'm not sure I did it  in the correct way)

    And I'm getting it in my HomeController like this:

     public ActionResult GetWithAttach(int id,string name)
            {
                return View(_repository.GetWithAttach(id, name));
     
            }<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    so now I'm suppose to get it in partial view (?) and loud it in my select page ?

    Hmm ,how ? or is there any other way I didn’t think/know about ?

    hop I'm clear

    Thanks


     

    Wednesday, February 2, 2011 8:51 AM

Answers

  • User-1620313041 posted

    Finding the ones with the same subject....is not an easy thing! Modelling the fact that two videos pr two images are somewhat relate is a complex job and is the "secret" of the success of Google and YouTube. There are algorithms based on semantic nets, but tuning them is not easy.

    If you have a simple catalog based on subjects, you can just retrieve all videos with the same subject. That is you first find the unique video that has been required, then  you take its subject filed and do another Linq query to find all videos with the same subject put the.

     

    Your ViewModel will contain a property with the object representing your initial video, and another property that is a list of objects represention the videos with the same subject.

     

    For the video with the same subject you don't need to retrieve the BLOB containing the video. it si enough to put on the screen an img tag for each of them with an url that calls a controller that retrieve a small Thumbnail of the video. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 6, 2011 1:43 PM

All replies

  • User-1620313041 posted

    I have not understood what you problem is. You selected jus one record from a table by using the values of two fields, correct?

    If yes what you have done is correct. On the other side you trying to access data in different tables, maybe your approach is wrong. 

    Wednesday, February 2, 2011 9:44 AM
  • User197322208 posted

    when the user select item , I would like items that are related data  in the "name column"

    Will be fire hopefully I'm clear

    No, it's not clear. Please explain( and do you mean fire or fired ? ;-) )


    Wednesday, February 2, 2011 10:33 AM
  • User712082397 posted

    If you are trying to display a record from UserVideoLecs entity then what you have done is fine.

    It will fetch a record from UserVideoLecs based on ID and NAME fields and return it to the "GetWithAttach" view.

    What you have to do here is create a "GetWithAttach" view and create some markup (using HTML and HTML Helpers) to display that record.

    Wednesday, February 2, 2011 10:35 AM
  • User1860059286 posted

    Thanks , I'll try to explain myself a bit better <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    Ok. What I'm trying to achieve is :<o:p></o:p>

    When the user select an item from my video list ,<o:p></o:p>

    (just like in youtube) that related video are display.<o:p></o:p>

    thanks <o:p></o:p>

     

    Thursday, February 3, 2011 3:58 AM
  • User-1620313041 posted

    Yes but what does id and name are? Are they in the same table? Does id is the primary key of the table containing the videos? 

    Thursday, February 3, 2011 11:52 AM
  • User1860059286 posted

    Yes but what does id and name are? Are they in the same table? Does id is the primary key of the table containing the videos? 

     

     

    thanks ,

     yes I should explain,

    the id is primary key and a unique identifier there are both on the same table <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    Thursday, February 3, 2011 11:54 PM
  • User-1210061641 posted

    Hi Assafg2,

    Partial view can do this. When the user select an item from the video list, post the "Id" and "name" to the action, you can implement this by a form or javascript/JQuery. In the main view, use renderAction("action name") to render the partial view.

     

    Hope this helpful,

    Forest Cheng

    Friday, February 4, 2011 3:44 AM
  • User-1620313041 posted

    ok if both id and name are in the same table you just don't need name, id is enough to retrieve the whole table record. So you can put just the id in your LinQ where clause.

    The Linq clause will load the whole DB row, including the BLOB that contains your video.

    Once obtained the Binaries of the video you may use it as return value for some action method of a controller As FileResult

    If you want to display a page that has both the video and othe information, just display the page containing all information and put inside it some plug-in that is able to play videos (for instance a silverlight program) passing to the plugin an url that point to the action method that returns the FileResult with the video inside it.

    Friday, February 4, 2011 5:35 AM
  • User1860059286 posted

    ok if both id and name are in the same table you just don't need name, id is enough to retrieve the whole table record. So you can put just the id in your LinQ where clause.

    The Linq clause will load the whole DB row, including the BLOB that contains your video.

    Once obtained the Binaries of the video you may use it as return value for some action method of a controller As FileResult

    If you want to display a page that has both the video and othe information, just display the page containing all information and put inside it some plug-in that is able to play videos (for instance a silverlight program) passing to the plugin an url that point to the action method that returns the FileResult with the video inside it.

     

    Hi, thanks ,

     I'm afraid I did not explain what I need clear,

    (or I just didn’t understand  your answer   ),

    I'm trying to load like in you tube that when I movie is selected a list of movies with  the same subject are  displayed

    ( I able display movie on my site)

    thanks

    Sunday, February 6, 2011 8:55 AM
  • User-1620313041 posted

    Finding the ones with the same subject....is not an easy thing! Modelling the fact that two videos pr two images are somewhat relate is a complex job and is the "secret" of the success of Google and YouTube. There are algorithms based on semantic nets, but tuning them is not easy.

    If you have a simple catalog based on subjects, you can just retrieve all videos with the same subject. That is you first find the unique video that has been required, then  you take its subject filed and do another Linq query to find all videos with the same subject put the.

     

    Your ViewModel will contain a property with the object representing your initial video, and another property that is a list of objects represention the videos with the same subject.

     

    For the video with the same subject you don't need to retrieve the BLOB containing the video. it si enough to put on the screen an img tag for each of them with an url that calls a controller that retrieve a small Thumbnail of the video. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 6, 2011 1:43 PM