On basis of this i understood that for the first time when page loads IsPostback value will be false. and for ever next time when i change the value of ddl, IsPostback value will be false assuming that autopostback for dropdown is set to "true". But I am
getting IsPostback as "false" every time when i selects value from ddl. Can you please suggest what could be the reason ?
Problem is whenever I am selecting value from drop down, i am getting IsPostback value as false. I have varified AutoPostBack property of ddl which is set to "true". Can there be any other reason for this. ? kindly suggest.
I have a doubt.. Please help me on clarifying this. what will be the impact on IsPostback if i select from drop down? What will be the impact on IsPostback if i clicks on button on page? How this is different from each other.?
Hi Hari869,
Yes there is 1 difference between both controls present when dropdownlist doesn't have AutoPostBack property is set true.
Whenever you click Asp.net Button, Postback occurs
When you set AutoPostBack="true" in Asp.Net Dropdownlist, then postback occurs otherwise not.
Whenever Postback occurs, whole page is reload if you are not using any update panel.
Hari869
Member
2 Points
8 Posts
IsPostback
Jan 23, 2013 05:58 AM|LINK
Hi,
I have a doubt.. Please help me on clarifying this.
what will be the impact on IsPostback if i select from drop down?
What will be the impact on IsPostback if i clicks on button on page?
How this is different from each other.?
Harish
anuj_koundal
Contributor
2088 Points
495 Posts
Re: IsPostback
Jan 23, 2013 06:01 AM|LINK
Both are same and Whole page and contents will reloads on Postback.
Regards
Anuj Koundal
brijeshvaidy...
Participant
848 Points
231 Posts
Re: IsPostback
Jan 23, 2013 06:02 AM|LINK
if you set your dropdown feature, autopostback="true"
then when change in ddl, the pase is post back otherwise not.
and on button click it will always post back if it has any cliked event written on code behind otherwise not.
Brijesh Vaidya
India
Hari869
Member
2 Points
8 Posts
Re: IsPostback
Jan 23, 2013 06:16 AM|LINK
Thanks for clarify this ...
On basis of this i understood that for the first time when page loads IsPostback value will be false. and for ever next time when i change the value of ddl, IsPostback value will be false assuming that autopostback for dropdown is set to "true". But I am getting IsPostback as "false" every time when i selects value from ddl. Can you please suggest what could be the reason ?
Thanks in advance.
Harish
anuj_koundal
Contributor
2088 Points
495 Posts
Re: IsPostback
Jan 23, 2013 06:31 AM|LINK
If you use
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"> </asp:DropDownList>Then every time you select an item in the dropdown list this will send request to the server and your whole page will reloads.
if Used like this
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="false"> </asp:DropDownList>Then No request will be made to server for page reload.
Regards
Anuj Koundal
Hari869
Member
2 Points
8 Posts
Re: IsPostback
Jan 23, 2013 06:41 AM|LINK
Hello Anuj,
Thanks for your reply ...
But everything is fine in DropDownList AutoPostBack is set to "true" even though i have same problem
I have a doubt on EnableViewState of page which is set to ture
Can anyone please advice .....
Thanks,
Harish
Harish
anuj_koundal
Contributor
2088 Points
495 Posts
Re: IsPostback
Jan 23, 2013 06:46 AM|LINK
EnableViewState is always true this is the mechanisim of Asp .net to maintain the state of the stateless pages.
What's your actual problem Is? Can you explain?
Regards
Anuj Koundal
Hari869
Member
2 Points
8 Posts
Re: IsPostback
Jan 23, 2013 06:53 AM|LINK
Problem is whenever I am selecting value from drop down, i am getting IsPostback value as false. I have varified AutoPostBack property of ddl which is set to "true". Can there be any other reason for this. ? kindly suggest.
Harish
anuj_koundal
Contributor
2088 Points
495 Posts
Re: IsPostback
Jan 23, 2013 06:56 AM|LINK
How do you checking this
Regards
Anuj Koundal
matifnadeem
Contributor
4616 Points
1094 Posts
Re: IsPostback
Jan 23, 2013 06:58 AM|LINK
Hi Hari869,
Yes there is 1 difference between both controls present when dropdownlist doesn't have AutoPostBack property is set true.
Whenever Postback occurs, whole page is reload if you are not using any update panel.
Let me know if any query remains.
Cheers
M Atif Nadeem
Mark as Answer if you got right thing
Read my blog | Follow me on LinkedIn