asp.net 2005 menu - not sure what is the postback

G

Guest

I have an asp menu control with menu items navigateUrl set to come back to
the same aspx page but with different values in a url token. this works, but
it is causing all my asp controls to loose their values.
Why is this happening? I thought I was "posting back" and my web controls
with viewState=true should retain their values?
Is this not the way to go about an aspx page coming back to itself?
 
K

Kevin Spencer

From the .Net SDK:

"When the user clicks a menu item, the Menu control can either navigate to a
linked Web page or simply post back to the server. If the NavigateUrl
property of a menu item is set, the Menu control navigates to the linked
page; otherwise, it posts the page back to the server for processing."

A menu item that navigates "to a linked Web page" is simply directing the
browser to make a Request for that page's URL. This is a GET Request,
similar to typing in the URL in the browser's address box. And of course,
that means that PostBack does not occur. I would recommend using the
PostBack option for your menu control instead.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
G

Guest

Thanks Kevin.
That was the answer.
Jay


Kevin Spencer said:
From the .Net SDK:

"When the user clicks a menu item, the Menu control can either navigate to a
linked Web page or simply post back to the server. If the NavigateUrl
property of a menu item is set, the Menu control navigates to the linked
page; otherwise, it posts the page back to the server for processing."

A menu item that navigates "to a linked Web page" is simply directing the
browser to make a Request for that page's URL. This is a GET Request,
similar to typing in the URL in the browser's address box. And of course,
that means that PostBack does not occur. I would recommend using the
PostBack option for your menu control instead.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
D

darrel

I would recommend using the PostBack option for your menu control instead.

Except that would require a dependance on Javascript, correct?

If so, you may want to reconsider if you are concerned with accessibility at
all.

-Darrel
 
K

Kevin Spencer

The use of JavaScript in an HTML document in and of itself does not
necessarily have any impact on Accessibility. What exactly do you think is
going to be affected by this?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
D

darrel

The use of JavaScript in an HTML document in and of itself does not
necessarily have any impact on Accessibility. What exactly do you think is
going to be affected by this?

Anyone without javascript...those using screen readers, certain PDAs, text
browsers, indexing bots, people that just get annoyed with it...etc.

..net tends to assume that every app developed is for an internal IE web
application for sighted people with full motor control skills ;o)

Which, to be fair, is fine, as a lot of apps are done that way. But if you
are designing public facing sites, a lot of the built-in controls are less
than ideal much of the time.

-Darrel
 
J

JIMCO Software

darrel said:
.net tends to assume that every app developed is for an internal IE
web application for sighted people with full motor control skills ;o)

I strongly disagree with this statement. ASP.NET adaptive rendering is a
powerful method for dealing with these issues.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

Merry Christmas from JIMCO Software!
 
K

Kevin Spencer

You didn't answer my question. You stated that using JavaScript in a menu
would affect accessibility. I asked you to be specific about how
Accessibility would be affected. If you want to be believed, you have to
provide some evidence that supports what you say. "Accessibility" is a term
with a meaning. The W3C has written a lot about it. Have you read any of it?
Here's a good place to start:

http://www.w3.org/WAI/
http://www.w3.org/WAI/guid-tech.html
http://www.w3.org/TR/1998/WD-WAI-PAGEAUTH-0203

You'll note that the W3C doesn't seem to think that JavaScript is bad for
accessibility. Instead, they have published guidelines about how to use it
in ways that do not harm accessibility.

After reading through that, come on back and tell me again how JavaScript
will affect accessibility in a menu, and specifically, in the ASP.Net Menu
Control.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
D

darrel

You didn't answer my question. You stated that using JavaScript in a menu
would affect accessibility. I asked you to be specific about how
Accessibility would be affected. If you want to be believed, you have to
provide some evidence that supports what you say. "Accessibility" is a
term with a meaning. The W3C has written a lot about it. Have you read any
of it?

Yes. Quite a bit, in fact.

I'm not sure why it's so hard to understand that javascript-based navigation
is inaccessible to anyone without javascript.

JIMCO mentioned Adaptive Rendering. I haven't played with that, but will
take a look at it (not sure how it handles postbacks, though without
javascript...)
You'll note that the W3C doesn't seem to think that JavaScript is bad for
accessibility. Instead, they have published guidelines about how to use it
in ways that do not harm accessibility.

And relying solely on javascript for navigation certainly harms
accessibility.

Also, there's a large difference between the technical recommendations and
actual implementation of accessibility (and usability, for that matter)
issue.

Ie, being bobby-validated doesn't necessarily mean your site is actually
accessible to a person.
After reading through that, come on back and tell me again how JavaScript
will affect accessibility in a menu, and specifically, in the ASP.Net Menu
Control.

Does the ASP.net menu control generate javascript-based postback triggers
for navigation? If so, does it do it unobtrusively or will the menu not work
if one doesn't have javascript?

We haven't upgraded to .net 2.0 so haven't taken a look at this control in
detail yet. MS may very well have made accessibility improvements to their
controls. I'd love to see one of these controls in actual use on a site. Do
you know of any examples?

-Darrel
 
D

darrel

We haven't upgraded to .net 2.0 so haven't taken a look at this control in
detail yet. MS may very well have made accessibility improvements to their
controls. I'd love to see one of these controls in actual use on a site.
Do you know of any examples?

I jsut watched this:

http://channel9.msdn.com/Showpost.aspx?postid=130659

And there are some definite improvements to .net in 2.0 in terms of
accessibility. Alas, it just glossed over the menu control, so I'm still a
bit uncertain as to what new accessibility features it added.

I did a bunch of research this past season looking for an accessible, usable
drop-down menu script and of the dozen or so I looked at, the only one that
really passed the test was this one:

http://www.udm4.com

Unfortunately, fly-out navigation, by it's very nature, is less accessible
than menus that don't fly out, but this was a pretty good script if one
really needed the fly-out navigation.

-Darrel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top