Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts,
I am new to Asp.Net MVC. While going though the advantages of MVC, i studied that we can have complete control over rendered HTML.I am not able to understand how?

Please guide me.

Thanks in advance.
Posted
Updated 8-Jun-12 1:12am
v2
Comments
RDBurmon 8-Jun-12 8:26am    
Thanks Everyone who replied to this thread , So P.Salini , I think you have got enough response and you should be able to mark it as your answer and close the thread.
P.Salini 8-Jun-12 23:26pm    
Yes i got enough answers.Just now i have gone through it.

This means that unlike ASP.NET Webforms, MVC does not generate garbage control ids. This makes CSS styling and Javascript development easy. Further, it helps in performance of a site. ASP.NET MVC forces to be more in sync and close to HTML.
There are no repeaters, datagrids or such controls that magically generate markup for you.
There are no hidden fields to persist state for you.

More or less, it's just the HTML that you need to work with.
 
Share this answer
 
Comments
codeBegin 8-Jun-12 7:27am    
+5
Manas Bhardwaj 8-Jun-12 7:30am    
well explained +5
P.Salini 8-Jun-12 23:27pm    
Thank you. My 5
VJ Reddy 9-Jun-12 20:40pm    
Good answer. 5!
Server controls render themselves as HTML, but not necessarily the HTML you want. MVC solves this by outputting clean HTML using what is known as 'HTML helpers'. An added benefit of the framework is, you can customise these helpers to add your own custom controls to render whatever HTML you require.

Look at the articles below to read more about HTML Helper:

http://www.asp.net/mvc/tutorials/older-versions/views/creating-custom-html-helpers-cs[^]

http://stephenwalther.com/archive/2009/03/03/chapter-6-understanding-html-helpers.aspx[^]
 
Share this answer
 
Comments
P.Salini 8-Jun-12 23:30pm    
Thank you. I will go through those links.
VJ Reddy 9-Jun-12 20:41pm    
Useful references. 5!
Manas Bhardwaj 9-Jun-12 20:49pm    
Thanks1
Look at this

As per my knowledge

The main advantages of the MVC models are clear separation of concerns, unit testing facility, and more control over the URLs and HTML. The MVC model does not use Viewstate, Postbacks, Server controls, and server-based forms that enable full control over the application and html rendered by the Views

Thanks
SP
 
Share this answer
 
Comments
P.Salini 8-Jun-12 23:30pm    
Thank you.
hi,
when we are using asp.net normally we are using server side controls (ex textbox,dropdown,grid etc.), that will generate HTML code by it self only more ever view state also generate some HTML code.
while in MVC when programmer is developing view, normally programmer are using basic HTML tags or HTML helpers (which is nothing like user controls in asp.net)
so no sever side controls and programmer has complete control over HTML rendered.
 
Share this answer
 
Comments
P.Salini 8-Jun-12 23:31pm    
Thank you.
 
Share this answer
 
Comments
P.Salini 8-Jun-12 23:31pm    
Thank you. i will go through it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900