By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

Determining which control cause post back??

P: n/a
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

Mar 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<su******@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
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

Mar 19 '06 #2

P: n/a
Hi Teemu Keiski ,
Thanks alot for your comment. It cleared my doubt.
Sunil

Mar 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.