473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Determining which control cause post back??

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
2 2169
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
Hi Teemu Keiski ,
Thanks alot for your comment. It cleared my doubt.
Sunil

Mar 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brennon Arnold | last post by:
I have a problem that I figured would be relatively common, but have been unable to find any information on it as of yet. I have a page that contains two DropDownList controls, with the second...
2
by: Jeff Voigt | last post by:
Is there any way to dynamically get the name of the control that caused the postback? Since SmartNav is not working for me I'm trying to implement a way to scroll to the control that caused the...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
3
by: Fred Nelson | last post by:
I'm devloping a Web Application in VB.NET. In my web.config file I have specified that untrapped errors are to be sent to the page "errorpage.aspx". This is working fine - if an untrapped error...
8
by: John Smith Jr. | last post by:
I am looking for some way to persist a table web control so when page_load event comes up, i can display the table as it was. I tried using ViewState with the rows collection but that didn't work...
4
by: RTM | last post by:
Can anyone help me with the following issue? I've seen some similar questions here, but none relating to a textbox control.... I have a form with several controls, one of them being a textbox...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
4
by: dchillman | last post by:
string ctrlname = page.Request.Params.Get("__EVENTTARGET"); if (ctrlname != null && ctrlname != string.Empty) { return this.Page.FindControl(ctrlname); } I have a form on which I was trying...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.