Results 1 to 8 of 8

Thread: Wierd Question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954

    Wierd Question

    I am not sure where to post this question, but I thought that I would start here. I have a simple aspx page that work just fine. But when I try to go into design view (in the html editor) it gives me the attached error message. I found a tid on msdn here:

    http://msdn.microsoft.com/library/de...DDBLQUOTES.asp

    I went through my entire page and can not find one instance of "<%" or '<%'. I wll paste the page of that is needed.

    Anybody?
    Attached Images Attached Images  

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    Anyone?

  3. #3
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366
    Post the page.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    here ya go.....thanks!
    Attached Files Attached Files

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Are you looking at the html? There are a bunch of <% %> in there. Although I'm not sure what the trouble is as I can't reproduce the error off of just that page.

  6. #6
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366
    Yikes, just when I thought I'd seen the last of old asp... hmmm, i could reproduce the probs, one prob is in this code:
    VB Code:
    1. <INPUT type="text" name="tInputDate" value="<%if cstr(sInputDate) <> "" then
    2.     response.write(cstr(sInputDate))
    3. else
    4.     response.write(DateTime.Now.Today.ToShortDateString )
    5. end if%>">
    Change to this:
    VB Code:
    1. <INPUT type="text" name="tInputDate" value="<%if cstr(sInputDate).Length > 0 then
    2.     response.write(cstr(sInputDate))
    3. else
    4.     response.write(DateTime.Now.Today.ToShortDateString )
    5. end if%>">
    ...note the check on length.

    I'm a little confused. This looks like an old asp page, with one or two .net additions added to it. is that what the page is? the way you do the "checked" attribute for checkboxes might have worked in old asp, but not asp.net. if you wrap those tags used for determining the "checked" attribute in single ticks, it'll let that through to the designer but i think it's a lame hack(empty ticks are left in the input tag if it's not checked).

    If it's an old asp page, i'd consider rewriting it from the ground up for asp.net OR keep it in it's original old asp form and take out the .net stuff. It doesn't look like you're adding much to that page with .net goodies anyway. however, since i'm only looking at one page of your project there's a pretty good chance that i might be missing something. if you're not doing anything funky with session state, then that page could remain an old asp page and still work like a champ in a .net solution(probably have to change the code in that usercontrol, to an asp file and include it or something.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    Actually, it's just how this shop does things. They really use classic asp mixed in with some .net. I agree it doesn't make any sense. I switched that line, but still got the error any other suggestions?

  8. #8
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366
    Well, you'd have to update all of the lines to make that page work(including everything with the checkboxes). BTW, to debug that page I yanked out all code and added it section by section until i got an error, then isolated that code in a new page to make sure it was reproduceable(sp??).

    My suggestion probably isn't going to work for you. Whoever put those lines in didn't do it through the designer, right(otherwise they would've received the same error you did)? so i'd say stay out of the designer(i've been doing webprojects in vs.net for almost 2 years and have not had a situation where i've needed that designer, it mucks up your html anyway) That's one suggestion. Another would be to figure out a way for the checked attribute to work using inline code. Start with an empty page and a checkbox input tag and figure out how to make it work with switching back and forth in the designer. I'd stick with the "stay out of the designer" suggestion, you'll get more work done, it's not really necessary. Maybe someone else has better solutions though.(oh and guide your fellow coders to stop mixing old asp techniques with the new stuff, make the jump!!you'll all be happier)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width