ASP.NET 2.0 - scaffolding a database table for webforms - asp.net

Can you recommend a tool that can analyze a SQL database table, read the table columns, and populate an .aspx page with appropriate controls (i.e. textboxes with matching labels)?
See this demo of ComponentOne InputPanel for WinForms for the functionality desired.
Are there any built-in tools for ASP.NET 2.0 WebForms that can help build a scaffold page for any given database table or entity?
Are there any free components out there to help achieve this goal?

Have you considered using an ASP.NET Dynamic Data page for this?
Here's a Getting Started video. It focuses on using VS 2008.
If you can't directly use the output of Dynamic Data due to a v2.0 limitation, you could perhaps fire up a new DD project in 3.5, and have the scaffold built for you. Then copy-paste the resultant markup, and paste into your 2.0 page. That would get you a head-start on not having to create all those asp:textbox and asp:dropdownlist controls yourself. You'd then have to wire up the DataSources as you see fit.

Related

Conversion from Coldfusion to Asp.net (Drag and Drop Functionality)

I have Coldfusion web application that has a CF query from a database table. This data is displayed in an HTML table with a checkbox beside each data item and an associated picture. There is Jquery functionality on the page so that the items can be re-arranged in the table based on the users preference. After the user finishes with their re-arrangement, it is re-displayed without the checkboxes for sending as an email. Note I did not write this application myself but inherited it...
I need to transfer this functionality to a asp.net C# web application but i am at a crossroads on how to proceed. I've looked at telerik controls and others but none appear to fit the functionality i need. Any solid suggestions?
I'd suggest to handle rendering of the table yourself. If you're using asp.net webforms, this can be done with a custom server control. If you're using asp.net mvc (which I suggest as MVC matches the coldfusion development model a bit closer than webforms), then it's much simpler and you can just do so in the view.
Once you are rendering the grid yourself, then it's simple to apply the jquery functionality on the client-side.
Without more info about what you can or can't do, it's a bit difficult to offer any more guidance. But you did only ask for suggestions :-)
Asp.net doesn't mean you need to use a library control built for .net. jQuery is powerful enough today, and it's not tied to any back end technology.
So, that being said, I would still go with jQuery and back it up with RESTful request using webservices with WebForms or controllers with MVC.
Have a look at this: JQuery Drag and Drop features with ASP.NET

ASP.NET DataGrid, DevExpress Grid or Report

I am new to asp.net and I want to create a table on my site.
The table should display data in a year-by-year manner (every row is another year).
When a row is clicked data in the table should change to the month-by-month data and so on.
I do not wnat to have another table under the first one or open new site.
i want to change columns and data binding in the table that is loaded as the first one.
I was wondering if it can be done using DataGrid or maybe I should think about some DevExpress
controls? I heard they are cool stuff :)
Oh, and one more thing - I want to generate report to pdf from data that is currently being shown.
Any suggestions how to do it? Like I said I am new in asp.net.
Thanks in advance for help.
surely you can use DevExpress ASPxGridView or even the MVC Grid extensions, both have no code required pdf/excel/HTML export. as you said, cool stuff, we just bought 14 licenses of their DXperience subscription, planning to use mostly the MVC and SL controls.
I don't know anything about DevExpress but I know what you are describing can be accomplished using a plain old ASP.NET GridView. The DataGrid is actually a somewhat deprecated control, so you wouldn't typically use that with a newer ASP.NET application.

MVC Custom Control?

I am trying to figure out how to use/create a custom control in ASP.NET MVC 2.
I created a custom control earlier and compiled it (ccontrol.dll), the control renders a div, textbox and a button + some javascript in order to post a comment on the website. It could be a static aspx page that i wanted to allow my visitors to add a comment to. I would then drag my control from the toolbar to the aspx page and run it, it would then render all the code needed on the webpage including fetching the data from a datasource and displaying that inside the div. The user could also just type in a comment and press the button to save it to the datasource.
Is this possible to convert to MVC 2? Any good tutorial that covers custom controls and MVC 2? (Ideally would be if the control could be made into a .dll file that i then could reuse on future webpages)
How do i write a custom control the mvc way? Any good tutorials on the topic?
You cannot design Custom Controls according the normal asp.net style because in Mvc there is no ViewState and there are no server side control events. Data are returned back to the server through a Model Binding process. The fact that rendering and filling data in are handled in separated pieces of code make difficult to implement complex server controls in Mvc.
However, I developed a theory, and also a toolset to make quite easily custom controls ina Mvc too in the full spirit of the Mvc paradigm i.e keeping separation of concerns between Views and Controllers. See My Codeplex project. There, you will find pointers to documentation and tutorials on my blog. If you need assistance feel free to contact me.
No it is not possible to use custom controls in ASP.NET MVC. you need to re-write in MVC way

ASP.NET Gridview Updating Capabilities

The Gridview control in ASP.NET provides updating capabilities when assigning a SqlDataSource control to the Gridview's DataSourceID, however when programmatically assigning a code level SqlDataSource to DataSource, the built-in updating capabilities go away and you are forced to roll your own. Why? What is the difference here, since all we're doing is referring to the SqlDataSource directly, instead of by ID? Why can the GridView still not take advantage of the SqlDataSource UpdateCommand?
Well, the first case, it has 2 native controls. Web and Data. You can perform RAD via VS.NET via their visual and configuration tools. MS ensure that the framework can allow such visual controls to data controls coupling in the aspect of CRUD automatically.
Second case, when you have your own SqlDataSource which is not one of the data controls, you are on your own. That's how it is. I hope someone can tell us a solution for it too.
my 2 cents.
I've discovered that it's possible to programmatically create a SqlDataSource, give it an ID, and assign the properties as follows to allow the built in editing to be mapped properly:
gvData.DataSourceID = dataSource.ID

Having different asp.net controls tied to each other by having the same datasource

In Winforms you can have two controls tied to the same datasource in a way that when you select a record in one of them, the same record is selected in the other control.
Something that has always bugged me is being unable to non programatically reproduce this behavior in web development. Is there any way to do this, framework, control toolkit, anything?
You will be able to in ASP.NET 4.0 with Sys.Observer.makeObservable.
The short answer is no.
In order to achieve this result in Windows Forms, the data presenter control (a DataGrid for instance) needs to trigger an event handled by the Datasource that, in turn, (as it keeps a list of all data presenter controls bound to it) order them to rebind.
Although this effect can be reproduced in a web scenario, it's definetly not simple because of a simple fact: It's not single layered. The Datasource is on server.
The framework or control toolkit that would expose this feature would need to create a client representation of the Datasource that would reproduce the process I described in Javascript or other technology.
I personally know Telerik, DevExpress and some other widely used frameworks and I ensure you. " non programatically" you won't be able to do this.

Resources