开发者

What is equivalent to a php page setup in asp.net

I program php, but I am trying to get into c# asp.net. In php I can make forms, custom html, etc into a seperate php file and just include it on the page that I desire. I understand asp.net has a master page which allows you to set the template for the whole website, but what If I want just a row of buttons to be on SOME pages, and not all? something separate to t开发者_Go百科he master page that can be included on any page i desire? Also when its controllers is that when I use .ascx?


Look at User Controls. You can program a control that consists of a row of buttons and then put it on whichever pages you like.


There are two different approaches to ASP.NET nowadays.


ASP.NET WebForms:

Each page (.aspx) can have a Master Page (.master). Each master page can further have its own master page. Master pages are optional altogether, but if present, at least one in the heirarchy will typically have the opening and closing html, head, body, and form tags.

Each page (and master pages too) can reuse html/logic within itself through Web User Controls (.ascx), for instance if you wanted to create a reusable comment box "control".

ASP.NET MVC:

Each View can have a master layout.

Each View or master layout can trigger the rendering of child/partial Views, for further reuse of html/logic.


Nowadays, if coming from PHP, I'd learn ASP.NET MVC instead of WebForms if I were you.


As DuckMasetro. Said, we can have master Page Concept. It Is easiest way to do.. You can Design master pages in Designer mode with liitle efforts. then Just Use MasterPageFile="url" this property in your Webforms Page Directive at the top of your aspx. page

Tutorials for Begginers

Documentation for Master Page in ASP.net

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜