locked
.aspx pages RRS feed

  • Question

  • I am attempting to set up my first contact information form using aspnet.

    Is the formatting for .aspx pages controlled by an external style sheet as with .html pages?

    Ron

    Sunday, March 23, 2014 4:56 PM

Answers

  • Interesting question. DWTs and ASP.NET master pages are not compatible. However, if you're using ASP.NET solely for your contact page, and you're going to get that page from ctrfx, then I imagine you'll have to style it to match the rest of the site once you see what you've got from ctrfx. Once you add the source code that you will need to add to recreate the necessary regions from the DWT, then you can simply attach the page to the DWT, and it will be updated as usual.

    At least, I think so. I don't think there's any reason why the in-page script section or the form itself will interfere with the functioning of the DWT, as long as the necessary regions are present. OTOH, I don't recall encountering a situation where the ctrfx form was used where the whole site was part of a DWT structure (as opposed to using ASP.NET master pages). If it doesn't work that way, you could simply manually update that page when changes were made to the DWT.

    In any event, the way that you style an ASP.NET page is to first preview the page, so that the ASP.NET code has been processed and rendered into HTML, then you View Source on the rendered page to see what ids or classes are assigned to the rendered elements, then write the CSS to style those ids. Often, ids shown in ASP.NET code are changed when the page is rendered.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Edited by paladyn Monday, March 24, 2014 5:13 AM
    • Marked as answer by Aston W Tuesday, March 25, 2014 12:01 AM
    Monday, March 24, 2014 5:12 AM

All replies

  • Yes.

    Differences between HTML pages and .aspx pages:  The page declaration at the top, any C# or VB.net script section, a Form on the page inside which all asp.net controls are placed, and those asp.net controls.

    (When you use EW to create a new page, and choose an aspx page, you'll see in the Code view the basic framework for the page.)

    The visual look of the page, and any elements that are not asp.net controls, are put on the page the same way you create a standard HTML page.

    One complication is that you won't see the HTML for asp.net controls in the .aspx page itself; that HTML is created by the asp.net framework as it processes the page, and before sending the page down to the browser.  That means that styling asp.net controls needs to be done either using the control's properties, or by knowing how they will be rendered on the page sent to the browser and styling that.   (View source when previewing an .aspx page, and you'll see what is sent to the browser.) 

    Sunday, March 23, 2014 5:43 PM
  • Will I be able to create a DWT (.aspx page) for forms with a corresponding .css page, where I can insert divs above and below the form div?

    In addition, can I do any formatting to the form div itself? (eg. color, border, etc..without trying to fool around with the controls?
    Monday, March 24, 2014 4:38 AM
  • Interesting question. DWTs and ASP.NET master pages are not compatible. However, if you're using ASP.NET solely for your contact page, and you're going to get that page from ctrfx, then I imagine you'll have to style it to match the rest of the site once you see what you've got from ctrfx. Once you add the source code that you will need to add to recreate the necessary regions from the DWT, then you can simply attach the page to the DWT, and it will be updated as usual.

    At least, I think so. I don't think there's any reason why the in-page script section or the form itself will interfere with the functioning of the DWT, as long as the necessary regions are present. OTOH, I don't recall encountering a situation where the ctrfx form was used where the whole site was part of a DWT structure (as opposed to using ASP.NET master pages). If it doesn't work that way, you could simply manually update that page when changes were made to the DWT.

    In any event, the way that you style an ASP.NET page is to first preview the page, so that the ASP.NET code has been processed and rendered into HTML, then you View Source on the rendered page to see what ids or classes are assigned to the rendered elements, then write the CSS to style those ids. Often, ids shown in ASP.NET code are changed when the page is rendered.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Edited by paladyn Monday, March 24, 2014 5:13 AM
    • Marked as answer by Aston W Tuesday, March 25, 2014 12:01 AM
    Monday, March 24, 2014 5:12 AM
  • "In addition, can I do any formatting to the form div itself? (eg. color, border, etc..without trying to fool around with the controls?"

    I answered that in my response.  I'm not sure why it was not clear to you.

    Monday, March 24, 2014 5:48 AM
  • Scott:

    I was able to get my first form working (yeah!!) I used to CTRFX method, and have already added a drop-down list using EW, so it looks like I'm on my way insofar as these types of contact info forms.

    You have no idea what a relief that is for me. I did try to save the file as a DWT, adding several divs, etc. and tying to an existing css page. The formatting works outside of the actual form itself, and I am sure that I will learn how to format text, etc. within the form itself (which was to be expected)

    However, even though I saved it as a DWT, it does not show up in the list of DWT's when I go to start a new page.

    I simply renamed the page, published it as a .aspx page and all works. Unless there is some alternative, I am okay with living with it as a straight template form page. (I will only have about 5 such form pages max. on the new site.)

    Ron

    Monday, March 24, 2014 4:21 PM
  • Frankly, DWTs were not designed for aspx pages.  There is an asp.net concept called "Master pages" for that, but they are more complex to work with if you are new to asp.net.

    If they update correctly with the DWT, you could certainly use it.  Otherwise, detach it from the DWT and do any future changes manually for the asp.net forms.

    Monday, March 24, 2014 5:37 PM