I want to extract/fetch url data in my asp.net mvc3 application. How can i ectract url data. Its like facebook does in wall post.
http://www.9lessons.info/2010/06/facebook-like-extracting-url-data-with.html
How can i do that? any reference or demo available for asp.net mvc3 application?
You need to use the WebClient class to fetch an external page, and the HTML Agility Pack to parse it.
Related
I am trying to figure out how I can pass model data from a controller to a razor view in a non-mvc Razor Pages web application.
We have a system in process where we currently generate a model, and send it off to an external service which will bind a razor template with the model and send an email. We need to migrate away from the external service and switch over to our existing mail service. I already have the model ready to post to an endpoint, and I have the code that will send an email with the html body. All the examples I have seen for Razor Pages either generate the model in the cshtml.cs file. I can create a web app that has a controller with an endpoint where I can post the json model (which I deserialize to a custom class), and I have razor pages that can bind to my custom class. I just can't figure out how I can go from the controller that receives the request, to passing that data to the Razor page to render the view.
Yeah, after hours of searching I posted this and was presented with a "Does this answer your question" suggestion before posting. I was "No, that is not it." After posting and re-reading, yeah, that was it. :(
Answer here:
How pass objects from one page to another on ASP.Net Core with razor pages?
I'm new to front-end MVC and I decide to create a SPApplication then I found this angularJS. Of course, other MVC as well but I prefer angularJS.
Ok, my questions here.
Before this, I normally store my MVC files at backend MVC folders which is codeigniter view folder if it is html partial or page.
So is it the time to move the backend MVC to frontend?
Another question, what is codeigniterRest? do I need it to use with angularJS?
No, the backend MVC in CodeIgniter and the frontend MVC in Angularjs have a separate role totally.
The backend MVC will handle the data sent to the app by your frontend.
The frontend MVC in angularjs will receive a response (usually in json) from the backend MVC in CI and handle that data using its views and controllers.
So your Single Page App will consist of all the bells and whistles of CI + 1 view page (or more if you break that page into partial includes) that will store the angularjs app in it.
Is there any updated example to upload files with a form with fields and file inputs that post to a mvc4 webapi controller?
I am trying to post with Jquery axax to a asp.net mvc4 ApiController.
I used the Jquery file Upload plugin for the client side part.
As the webapi seems not to support multiform data I tried to solve with this configuration formatter but still looking for a better solution
See: http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2
(Scroll down to "Supporting Multipart MIME Data")
I have not actually tried this with the jQuery plugin, only with plain HTML forms.
I am trying to convert my existing ASP.NET application to MVC 3 Razor. I use a lot of updatepanels, and I do conditional updates at the code behind using MyUpdatePanel.Update().
I am not finding this functionality with MVC 3. I can see a lot of blogposts talking about jQuery and how to use it to achieve the same, but I want to render other partialviews from my action conditionally. Is it possible to achieve it?
The way you'd work with Ajax in ASP.NET MVC is completely different from the ASP.NET way (i.e., Ajax toolkit with server-side controls such as UpdatePanel).
ASP.NET MVC is more basic and therefore more work. You handle Ajax calls on the client side using a library such as jQuery, and on the server side you implement a controller with Ajax methods.
Have a look at http://sweettam.blogspot.com/2011/06/aspnet-mvc-3-ajax-part-i.html.
I am looking to implement a live search in my MVC app similar to this site when you type in a question and results come up that are similar or like the search on http://www.krop.com/
I have the search code all working and results updated. I just need to know how to add the AJAX to the MVC framework (I know this site was built using it) so that when I type the results are updated.
I had this all working in normal ASP.NET Forms app.
what you need to do it attach to Jquery onchage event handler, and then call some ajax method of jquery ($.load , $.ajax etc...) and the information from a specified controller. asp.net mvc controller can return json results so you can later manipulate it in your javascript code.
if you have any other questions go ahead and ask.
An ASP.NET MVC site will have AJAX and JQuery available by default.
Mike Bosch's Blog can give you some pointers on this