Determining which control cause post back??

S

sunilthk

Hi All,
I have a question.
If javascript is disabled how asp.net determines which control has
caused the post back. As we know that when we clicks on the button the
buttons name goes with posted data, so asp.net can detrmine which btn
caused the post back. In case of dropdown lists(if auto post back is
true) _doPostback javascript function is called which assigns the name
of the control in _EVENTTARGET hidden variable, by this ASP.NET knows
which dropdownlist has caused the post back. My question is if
javascript is disabled, then _doPostBack js function will not be
executed then how ASP.NET will know that which control has caused the
postback.
Thanks
SunilT
 
T

Teemu Keiski

Hi,

if js is disabled, posting with js won't work either so of course in that
case, you don't have a postback to detect. E.g in that case posting would
work only with controls which do submit without javascript (input
type=submit e.g a Button basically).

Process to look for the control is always similar despite the js being
enabled or disabled. Controls are looked for in Request.Form collection
(either uniqueid directly as key or as value of __EVENTTARGET). So if you
have js disabled, it means controls doing postback with js just do nothing
and require other control to post on the server.

Note that control not being causer for postback, doesn't mean it couldn't
still raise events like DDL would raise SelectedIndexChanged when selection
changes, despite being submitted by itself or by a other postbacking
control, such as a Button
 
Joined
Jun 4, 2008
Messages
1
Reaction score
0
I would really appreciate if someone could please help me to guide how exactly I can fire the SelectedIndexChanged event of drop down list when javascript is disabled.

Thanks a lot in advance.
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top