1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

asp.net user control anyone?

Discussion in 'C#' started by pinkpanther, Jan 22, 2005.

  1. #1
    Hello programming board,

    I am seriously wondering.... if my navigation menu is made into a user control, hence an ascx file. And this user control is included in my default page and the only links that link to other pages in my site is in this user control, will the bots be able to find their ways to my other pages since in the html of my default page, there is only a reference to the user control, no links at all. what you guys think?
     
    pinkpanther, Jan 22, 2005 IP
  2. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .NET server-side controls result in ugly HTML, sometimes relying on client-side JS to work properly (or sometimes just to work). Here's MS' blurb on their reliance on JS: link

    With this in mind, whether your page is crawler-friendly or not depends on the functionality you used. Any generated HTML that relies on client-side script to do such things as submiting forms or activating links is not crawler-friendly.

    Hit your page with a browser and look at the HTML. If you see any server-generated script, chances are that crawlers won't get to the page you want them to see.

    J.D.
     
    J.D., Jan 22, 2005 IP
  3. pinkpanther

    pinkpanther Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A user control is like an include file. Basically just like a css file where you reference the file in the webpages where you want to use the css. My user control only has links in there and does not generate any client side script. When the webpage is requested by a user using a browser, on the webpage where I reference my user control turns into the content of my user control, which are the links, strictly html.

    You said:
    How about server generated html?

    I guess what I am not sure is, do the bots scan webpages on the server as is, or what they see is exactly what a browser sees?
     
    pinkpanther, Jan 23, 2005 IP
  4. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Not at all. Include files are read verbatim and just inserted into the resulting HTML at the specified position in the template. User controls are parsed by the server and the server maintains their state (e.g. if the radio button is selected, etc).

    Nobody is supposed to be able to look at the content of your aspx, ascx, etc, templates (if you can see some of them, your server is misconfigured and may be compromised) - the outside world sees only the HTML they generate.

    Getting back to your question, look at the generated HTML and make sure that 1) it does not rely on JS to function and 2) it is a valid HTML for the DOCTYPE you are using.

    J.D.
     
    J.D., Jan 23, 2005 IP
  5. pinkpanther

    pinkpanther Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the reply.

    For simiplicity and the purpose of my question, thats all I need viewers of the post to know , user controls and include files work similarly.

    Again client script is not something I need to worry about, so I guess I just need to be patient until the bots find all my other pages.... hurry up bots!!
     
    pinkpanther, Jan 23, 2005 IP
  6. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Your vaction page is wrapped in a form and does have client-side script, though. If JS isn't enabled, the function __doPostBack isn't going to be called and the part of your app that is supposed to handle this click will not be executed. If this part doesn't do anything, then you're fine. If it does, the HTML it generates won't be seen by crawlers.

    I can tell you right away, that your Contact Us link calls this function and it won't work if JS is disabled. So, this page most likely won't be indexed.

    J.D.
     
    J.D., Jan 23, 2005 IP
  7. pinkpanther

    pinkpanther Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, that page and only that page relies on js to be linked to, I am aware of it. That page does not really have the content people search for anyway. So for me, js is still not something I need to worry about.

    You are very thorough, I like that.... ;)
     
    pinkpanther, Jan 23, 2005 IP