How to create facebook kind of comment for my blog - asp.net

I am using C# asp.net. I want to implement a commenting system which is similar to facebook commenting system look & feel. Please give your inputs.

When it comes to storing,retrieving and displaying comments yes asp.net controls come into use.
Other things being done, to accept a comment and display existing ones for that object (may be post) I would do:
1: Retrieve the comments for that object from database. (easiest way is to use SqlDataSource and set Select, Insert and Delete commands)
2: Use ListView control to display the retrieved data . Remember ListView should be customized to fit you need
Other databound controls are also usable. With these rich controls this task should be easy. Play with the templates these controls offer you and you can achieve almost any database related task.
Design and styling are sufficiently supported and still CSS + can be easily integrated.

Related

WebForms detailsview -- are both Edit and Insert templates needed?

This question would apply to a typical CRUD page allowing the user to ADD, and/or EDIT a specific record.
Question about WebForms DetailsView control (and possibly FormView and GridView) -- Do we really need to specify BOTH the Edit-template AND the Insert-template which are essentially the same?
If not, which template should be designed/specified?
Your answer and comments are welcome.
Thanks...J.
In my experience you don't have to specify either template. In fact the only time I even use templates is if I want to customize certain attributes that you can only do via a template. I typically use templates when I want to have RequiredFieldValidators. Otherwise I don't use them at all. But you certainly can have neither, either or both.
That being said, I do usually have Item, Insert and Edit templates when I do need the extra flexibility of templates. Seems more complete to me.

Forms vs Tables for editable company profile

I am starting to build an app, using Meteor, that includes user-populated company profiles (including both financial data and text). I will be looking into a datafeed for public company information but much of the information for private companies will be user-populated.
I know I will need to create a form for the user to fill in so that the company information will be captured by the database. However, can I make this same form available to the user to both display the data and to allow them to edit the data in the future? Or do I need to build a separate view using tables for this purpose? My preference is the former, just one screen to create and edit as needed.
Any examples of similar instances would be very appreciated.
Thank you.
This is less of a meteor specific question, rather a general web technology question. Meteor can provide the data in the template of course, and it can offer events to process data and insert/update this to a database. This is the same as any underlying architecture. The question is really how to approach the problem with HTML & JavaScript.
A couple of potential methods:
Write your HTML to display the content in its non-editable form. Then provide an edit button to switch mode. When clicking this button switch on 'contenteditable' for the elements you wish to be edited: http://html5doctor.com/the-contenteditable-attribute/
Also reveal a save button, then process the event through meteor. Use selectors to extract the fields by referencing either designated class names, data attributes or name attributes. It would also be a good idea to alter the appearance of editable elements with a background or outline. The disadvantage here is that it's slightly non-standard and you may have the need for more complex data-types like dropdowns or checkboxes etc.
Create view with a standard form HTML. Style it in a way that shapes the information primarily for display rather than editing, eg. hide form field borders. Provide an edit button that when clicked alters the CSS and reveals form field borders, also reveal/replace elements which need more complex controls like dropdowns, perhaps turn on field labels too and of course a save button. The disadvantage is slightly more complex CSS and JavaScript.

ASP.NET: How do I create a widget/user control that can be used with other solutions?

I am looking to create a widget that can be used with other solutions. The widget is a competition widget that can be placed in different parts of the site.
What is the best way to do this? Should I create a new solution to hold this in?
Create a new class library project (you can have it within your current solution if it suits) and create your server controls in there. You can then reference this library from whatever websites you need.
You need to create a Web Control, not a User Control, if you want o use it in other projects. This question details the different control types, you may find it useful:
What is the difference between UserControl, WebControl, RenderedControl and CompositeControl?
Here is relatively simple tutorial on creating a custom WebControl:
Create ASP.NET Server Controls from Scratch
And here some more advanced example from MSDN:
Developing Custom ASP.NET Server Controls
It depends if you will be using it in other solutions really. If you are, then if might make more sense to create a new widgets solution with each widget in its own user control and compile it into an assembly.
Then you just reference that assembly and use it in your markup.
If your widget is only going to be used in a single solution then I wouldn't bother with the above. Just create a user control in the same solution.
As opposite of some answers, you should create user controls with embedded resources.
It is complex to do it, but once you do you will be able to develop controls like RadControls from Telerik.
If you open up their controls you will see that they are all embedded resources on the Telerik.Web.UI.dll.
Here is an old answer of mine that shows how to load the control and how to handle embedded resources (virtual path provider)
Unless you have a good reason to do so (like creating a generic control as a calendar, grid or something like that) don't go this way, it is dark, complex... But as you can see it might be worth it, Telerik.Web.UI is the live example that this can work out.

AJAX form editing and design

I want to build into mt ASP.NET application the ability for users to fill up forms, but the forms are not something I can hard-code into my (Enterprise) software.
So I need one screen that lets end users create the forms. Doing it the 2.0 way, I just love what PollDaddy did in their survey editor (great job guys!). How do I replicate that? (don't worry pollDaddy, my app has nothing to do with survey and I am not at all in your domain (-: )
Since you need to login to the site to play with it, I made a 20 sec video of how it looks like. Please see below and tell me how to best replicate this (as simple as using JQuery tip? use an entire open source project? Buy something?)
Requirements are:
support multiple types of elements (like multiple choice, free text, comboBox)
drag and drop
editing of order
click image for video or here
http://frame.revver.com/frame/120x90/1376799.jpg
The AJAX control toolkit is free and would work for some of this items shown in the video. However, JQuery has tons of plugins it is easy to extend and even easier to use. I would suggest starting there and extending it where needed.
Good Luck
You could build it yourself using an AJAX framework like ASP.NET AJAX or even telerik controls. You could use jQuery but ASP.NET AJAX is free and embeds well with ASP.NET pages. You could buy something, but I've yet to encounter packages as such.

What web control library to use for easy form creation with many different types of input fields?

I'm about to create a web application that requires a lot of different web forms where the user needs to be able to input a lot of different types of information. What I mean is that one of those forms may require some text input fields, some integer input fields, some decimal input fields, some date input fields, some datetime input fields, etc.
I would like to have a, maybe JavaScript-based, control library that I can simple provide with some text labels, input types and default values. The control library would then somehow render the form in HTML without me having to create an HTML table, select the appropriate standard web controls and all that.
I have used dhtmlxGrid to create quite a lot of tables and that works well for me. What I need now is something that can help me in a similar way when creating something like card forms.
I have also found ActiveWidgets, but it looks like it will require a lot of work on my behalf. I'm not only looking for individual web controls, but rather something like a library that can help me with the overall card.
I'm guessing many of you have had this problem before. Looking forward to hearing what solutions you have found to be the best. BTW: I'm working in VisualStudio with ASP.NET.
I would be tempted to look at Ext JS for this.
Ext JS
have you had a look at InputEx
I know it doesn't answer the question, but I have always written my own, or rather written it once and tweaked it for other apps. When I store the questions in the DB I store what input type it is, then on the form I dynamically create the appropriate control depending on which input type the question needs and add that control to a dynamically created table cell as I go.
If you choose to do that just remember when processing the form that the controls don't exist on postback, you need to recreate them.
It is not too bad to write it, if you have the time. My current form module is running a few dozen forms from the one module.

Resources