ASP.NET - dealing with Layout & positioning
It is much easier to build a website nowadays with Visual Studio 2005 because Microsoft has made the web development similar to windows application development. Of course, it may still not as good or as rich features as compare to Adobe (if they still have the web development software), but yet for simple development, it's good enough.
Using Visual Studio 2005, we could create a master page, which will be the main frame of the page, and we could create as many content page as we want that would reside within that master page, brilliant! (Top Gear word) However, there's 1 problem.
While placing the controls into the web page, we could use absolute positioning to move them to the desired location. Then, we could align those controls as well by few clicks. This works well in normal page, but in a content page, it doesn't. The controls will appear on an undesired location once the web page is rendered.
In order to fix this, there's another positioning called relative positioning, of which I haven't really found the meaning on what it really does, so let's google it later. What I did was I drag the controls into the content page, then with the control still selected, I clicked the relative positioning, and it automatically align itself within the content page, and we could proceed to make the alignment of all the controls as well.
There's another extra notes here. The controls must be arranged properly according to the source code. i.e. control A is above control B in WYSIWYG view, but in the source code, A is below B. This may affect the alignment operations greatly, and every time a new control being drag into the content page, A will be automatically shifted below the control. To fix this, in the source code, just cut and paste the control's code to the proper location. If this doesn't, just delete the control, put the cursor to the right location, and drag the control into the page. What I did was that I'll change to source/code view, point the cursor at the end of the control, then switch back to design view, and drag the control into the page. This way not only the flow is correct, the overall alignment operation will be fine too.
Using Visual Studio 2005, we could create a master page, which will be the main frame of the page, and we could create as many content page as we want that would reside within that master page, brilliant! (Top Gear word) However, there's 1 problem.
While placing the controls into the web page, we could use absolute positioning to move them to the desired location. Then, we could align those controls as well by few clicks. This works well in normal page, but in a content page, it doesn't. The controls will appear on an undesired location once the web page is rendered.
In order to fix this, there's another positioning called relative positioning, of which I haven't really found the meaning on what it really does, so let's google it later. What I did was I drag the controls into the content page, then with the control still selected, I clicked the relative positioning, and it automatically align itself within the content page, and we could proceed to make the alignment of all the controls as well.
There's another extra notes here. The controls must be arranged properly according to the source code. i.e. control A is above control B in WYSIWYG view, but in the source code, A is below B. This may affect the alignment operations greatly, and every time a new control being drag into the content page, A will be automatically shifted below the control. To fix this, in the source code, just cut and paste the control's code to the proper location. If this doesn't, just delete the control, put the cursor to the right location, and drag the control into the page. What I did was that I'll change to source/code view, point the cursor at the end of the control, then switch back to design view, and drag the control into the page. This way not only the flow is correct, the overall alignment operation will be fine too.
Comments