Hi, I have been getting more and more sick of all the quirks about control ids, trying to get your data in serverside (based on client-side events). I seem to spend more time fighting with controls in asp.net, that I think it takes me more time than I gain by using it.
I was thinking about using plain html/javascript with jQuery and a web service that returns json for the data.
The only thing I think I would miss from webforms is the MasterPages, the session management, authentication based on windows login and possibly validators(although they have some quirks too). (In fact, maybe not for sessions and auth, but I have never developped webservices)
- Is there something wrong with the way I am thinking about this, or something I didn't think about ?
- Are there things in asp.net that you think I will miss ?
- Has anyone done this before and wants to share experience ?
Please, also take note, that I only have the Framework 2.0 available for development.
Edit: The kind of things giving me troubles in asp.net that makes me wonder for the switch:
Here is a sample of a page giving me problems.
There is a tree table (master / details)
You can edit fields on each child row.
When you press the save button, the data from the group row must be updated (just data from a select, no modification in database), as the data from the child row.
I don't want to refresh the whole page because the displayed records are based from search criterias.
The Master / Details are generated using Repeaters
Trying to update a record from code behind is really quirky, and still have no clue about updating the display.
Using jQuery and a web service, my guess would be that i could update directly to the database, request what I want to be displayed and just update that record. This is the kind of things that make me wonder if asp.net is just getting in my way.
________________________________________________________________________ | - Some Details About Group | |________________________________________________________________________| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| | ChildRecord Some Editable Fields SaveButton | | ChildRecord Some Editable Fields SaveButton | | ChildRecord Some Editable Fields SaveButton | | ChildRecord Some Editable Fields SaveButton | |_______________________________________________________| ________________________________________________________________________ | + Some Details About Group | |________________________________________________________________________| ________________________________________________________________________ | + Some Details About Group | |________________________________________________________________________|
Edit2: The problem I have about ASP.NET is not related to ajax. Yes, I use jQuery to make the interfaces more dynamic like showing / hiding the search section when not needed and collapsing details from the tree, but this is all I do with it.
What bothers me is that if I want to check which button has been clicked in this example, I have to use some tricks that feel a bit haky.
If you want to use databound comboboxes in a repeater, you have to use codebehind to set the selected value, it will be a pain to retreive the data selected.
Next, if you want to check what data was modified, you have to save the datatable in the viewstate, read data from all controls in the repeater, then compare with the datatable to make an update. This is this kind of things that bother me with asp.net.