I’m looking for a tutorial on how to add a comment box to the end of an articles page on one of my sites. Examples of this can be found at the bottom of many web pages on the net, including all the tutorials on the
www.asp.net site. I just want to be able to put a blog post, a list of comments and a comment box all on the one page in MVC3 or 4.
I have been searching high and low and can’t find a way to do this in MVC3 or 4.
Seriously, can this not be done in MVC??? Looking at the below page, the url, looks like it could be MVC but it may not be??? Some kind of URL routing???
If you can not do - does not mean it can't be done. It is simple a problem of sending data via ajax and , on the server, saving the data.
Did you see my tutorial? DO you see how I save an existing employee with data (javascript + action )? It is the same for you -send the comment text + bloogpost id.
Hi Andrei, thanks and yes I see what you are doing but that’s not what I want to do!
For this site it just has to be simple and the last thing I want to add to it is more JS, there is way too much on it already, I’m quite happy for this blog to hit the server after a submit.
New Update to this thread and a brilliant coincidence!!!
I just posted “Great stuff, can’t wait to use it in the real world!” and my internet dropped out, I then refreshed my internet connection and the site hung saying my comment was been sent. I clicked the submit button a few more times, well you can see how
many timed if you look at the comments to the post…lol. I don’t want that happening to my blog!!! The whole time this site hung until I came back online and here I am!
Delete old question
So I guess my new question is, can I do what is done on the above mentioned site in MVC3 or 4 without Ajax, or should I just use Webforms?
I’ve been able to put the comments and the comments box one page all along, but couldn’t work out how to get the post on there two. You mentioned in another thread to just add Include(“Comments”), I now know what you mean so I will mark that as the answer
too.
Now I’ve been playing with the Ajax controllers and been having a bit of fun there!
bojangles
Participant
976 Points
644 Posts
MVC3 or 4 Comment box Tutorial
Feb 28, 2012 01:32 AM|LINK
Hi,
I’m looking for a tutorial on how to add a comment box to the end of an articles page on one of my sites. Examples of this can be found at the bottom of many web pages on the net, including all the tutorials on the www.asp.net site. I just want to be able to put a blog post, a list of comments and a comment box all on the one page in MVC3 or 4.
I have been searching high and low and can’t find a way to do this in MVC3 or 4.
Any help would be greatly appreciated, cheers,
Mike.
ignatandrei
All-Star
137716 Points
22159 Posts
Moderator
MVP
Re: MVC3 or 4 Comment box Tutorial
Feb 28, 2012 03:49 AM|LINK
please see
http://bit.ly/mvc_ajax_jquery
I add dynamic a new Employee to the table and render. It is good enough?
bojangles
Participant
976 Points
644 Posts
Re: MVC3 or 4 Comment box Tutorial
Feb 29, 2012 06:55 AM|LINK
Seriously, can this not be done in MVC??? Looking at the below page, the url, looks like it could be MVC but it may not be??? Some kind of URL routing???
http://www.asp.net/single-page-application/an-introduction-to-spa/overview/landingpage
I could write this in Classic ASP or Webforms in about two minutes and it now looks like I’m going to have to do it in Webforms.
I’m trying to move to MVC permanently but I constantly keep coming up problems with it,
Right now I have to move on with the website I’m building!!!
Disappointed,
Mike.
ignatandrei
All-Star
137716 Points
22159 Posts
Moderator
MVP
Re: MVC3 or 4 Comment box Tutorial
Feb 29, 2012 06:59 AM|LINK
If you can not do - does not mean it can't be done. It is simple a problem of sending data via ajax and , on the server, saving the data.
Did you see my tutorial? DO you see how I save an existing employee with data (javascript + action )? It is the same for you -send the comment text + bloogpost id.
bojangles
Participant
976 Points
644 Posts
Re: MVC3 or 4 Comment box Tutorial
Feb 29, 2012 08:13 AM|LINK
Hi Andrei, thanks and yes I see what you are doing but that’s not what I want to do!
For this site it just has to be simple and the last thing I want to add to it is more JS, there is way too much on it already, I’m quite happy for this blog to hit the server after a submit.
New Update to this thread and a brilliant coincidence!!!
I just posted “Great stuff, can’t wait to use it in the real world!” and my internet dropped out, I then refreshed my internet connection and the site hung saying my comment was been sent. I clicked the submit button a few more times, well you can see how many timed if you look at the comments to the post…lol. I don’t want that happening to my blog!!! The whole time this site hung until I came back online and here I am!
Delete old question
So I guess my new question is, can I do what is done on the above mentioned site in MVC3 or 4 without Ajax, or should I just use Webforms?
Cheers,
Mike.
ignatandrei
All-Star
137716 Points
22159 Posts
Moderator
MVP
Re: MVC3 or 4 Comment box Tutorial
Feb 29, 2012 08:54 AM|LINK
for sure.
Add a Html.BeginForm outside your textbox with comment, put a hidden field for blog id and post data! What will be the problem????
bojangles
Participant
976 Points
644 Posts
Re: MVC3 or 4 Comment box Tutorial
Mar 01, 2012 01:33 AM|LINK
Thanks as always Andrei,
I’ve been able to put the comments and the comments box one page all along, but couldn’t work out how to get the post on there two. You mentioned in another thread to just add Include(“Comments”), I now know what you mean so I will mark that as the answer too.
Now I’ve been playing with the Ajax controllers and been having a bit of fun there!
Thanks again,
Mike.