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:
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.
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.
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
assafg2
Member
211 Points
330 Posts
Loud similar item when selecting an item
Feb 02, 2011 12:51 PM|LINK
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));
}
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
francesco ab...
All-Star
20910 Points
3278 Posts
Re: Loud similar item when selecting an item
Feb 02, 2011 01:44 PM|LINK
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.
Mvc Controls Toolkit | Data Moving Plug-in Videos
ignatandrei
All-Star
134861 Points
21613 Posts
Moderator
MVP
Re: Loud similar item when selecting an item
Feb 02, 2011 02:33 PM|LINK
No, it's not clear. Please explain( and do you mean fire or fired ? ;-) )
sachingusain
Star
8786 Points
1702 Posts
Re: Loud similar item when selecting an item
Feb 02, 2011 02:35 PM|LINK
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.
Thanks.
assafg2
Member
211 Points
330 Posts
Re: Loud similar item when selecting an item
Feb 03, 2011 07:58 AM|LINK
Thanks , I'll try to explain myself a bit better
Ok. What I'm trying to achieve is :
When the user select an item from my video list ,
(just like in youtube) that related video are display.
thanks
francesco ab...
All-Star
20910 Points
3278 Posts
Re: Loud similar item when selecting an item
Feb 03, 2011 03:52 PM|LINK
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?
Mvc Controls Toolkit | Data Moving Plug-in Videos
assafg2
Member
211 Points
330 Posts
Re: Loud similar item when selecting an item
Feb 04, 2011 03:54 AM|LINK
thanks ,
yes I should explain,
the id is primary key and a unique identifier there are both on the same table
Forest Cheng...
Star
8370 Points
819 Posts
Re: Loud similar item when selecting an item
Feb 04, 2011 07:44 AM|LINK
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
Mvc 2.0 as.net
If you have any feedback about my replies,please contact msdnmg@microsoft.com.
Microsoft One Code Framework
francesco ab...
All-Star
20910 Points
3278 Posts
Re: Loud similar item when selecting an item
Feb 04, 2011 09:35 AM|LINK
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.
Mvc Controls Toolkit | Data Moving Plug-in Videos
assafg2
Member
211 Points
330 Posts
Re: Loud similar item when selecting an item
Feb 06, 2011 12:55 PM|LINK
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