i have a dropdownlist control populated with data and when you type any characters in the ddl
it will give you first matching characters and its work perfectly alright.
but seems to be there is a problem i have just realized that.
the problem is that:
whenever i enter any characters in the ddl, it goes to master.page_load
and execute all the code inside page_load event
even thou my page_load looks like this: but still execute all page_load event
if (!Page.IsPostBack && !Page.IsCallback)
{
..........................
}
how do i stop going into page_load every time ?
what might be the problem or any idea?
thanks
Its all about coding!
--------------------------
Don't forget to click "Mark as Answer" on the post(s) that helped you.
There must be some javascript or html code that causes the postback to the server-side, do you mean based on the code review to the client script you can not find
out which code caused the postback?
Normally, all the client postback is caused by __doPostBack javascript function except the submit button:
<script>
function __doPostBack(eventTarget, eventArgument) {
var theform = document.WebForm3;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
</script>
So you may check in Page_Load event of the http request collection for __EVENTTARGET value, this value should tell you which html element caused the postback.
Another way is do client side javascript debugging for __doPostBack function.
another thing is that
By default DropDownList doesn’t have auto-complete feature.
I think u r using some custom control that uses JavaScript to do that, right? or use Ajax? Anyway, post some HTML source on the result page would be helpful
thanks jessica
Jessica Cao
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
There must be some javascript or html code that causes the postback to the server-side, do you mean based on the code review to the client script you can not find
out which code caused the postback?
Normally, all the client postback is caused by __doPostBack javascript function except the submit button:
<script>
function __doPostBack(eventTarget, eventArgument) {
var theform = document.WebForm3;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
</script>
So you may check in Page_Load event of the http request collection for __EVENTTARGET value, this value should tell you which html element caused the postback.
Another way is do client side javascript debugging for __doPostBack function.
another thing is that
By default DropDownList doesn’t have auto-complete feature.
I think u r using some custom control that uses JavaScript to do that, right? or use Ajax? Anyway, post some HTML source on the result page would be helpful
thanks jessica
Hi Jessica,
thanks for your reply.
yes you are correct i'm using custom control that uses javascript and ajax to do auto-complete feature and i did a full search on my application and i dont find anything "__doPostBack"
how do i find or is there a way i can debug to know what cause the postback or i should say, is there a way to prevent the post back? :)
thanks again.
Its all about coding!
--------------------------
Don't forget to click "Mark as Answer" on the post(s) that helped you.
nisarkhan
Contributor
2402 Points
1472 Posts
page_load event executing everytime
Jan 18, 2007 06:14 PM|LINK
i have a dropdownlist control populated with data and when you type any characters in the ddl
it will give you first matching characters and its work perfectly alright.
but seems to be there is a problem i have just realized that.
the problem is that:
whenever i enter any characters in the ddl, it goes to master.page_load
and execute all the code inside page_load event
even thou my page_load looks like this: but still execute all page_load event
if (!Page.IsPostBack && !Page.IsCallback)
{
..........................
}
how do i stop going into page_load every time ?
what might be the problem or any idea?
thanks
--------------------------
Don't forget to click "Mark as Answer" on the post(s) that helped you.
Haissam
All-Star
37421 Points
5632 Posts
Re: page_load event executing everytime
Jan 18, 2007 07:03 PM|LINK
check if the autopostback property of the ddl is set to true, if yes set it to false.
Happy Coding
MCAD.NET
| Blog |
nisarkhan
Contributor
2402 Points
1472 Posts
Re: page_load event executing everytime
Jan 18, 2007 07:30 PM|LINK
i have
autopostback = false
--------------------------
Don't forget to click "Mark as Answer" on the post(s) that helped you.
Jessica Cao ...
All-Star
25328 Points
2567 Posts
Re: page_load event executing everytime
Jan 19, 2007 02:02 AM|LINK
hi,
first
There must be some javascript or html code that causes the postback to the server-side, do you mean based on the code review to the client script you can not find out which code caused the postback?
Normally, all the client postback is caused by __doPostBack javascript function except the submit button:
<script>
function __doPostBack(eventTarget, eventArgument) {
var theform = document.WebForm3;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
</script>
So you may check in Page_Load event of the http request collection for __EVENTTARGET value, this value should tell you which html element caused the postback. Another way is do client side javascript debugging for __doPostBack function.
another thing is that
By default DropDownList doesn’t have auto-complete feature. I think u r using some custom control that uses JavaScript to do that, right? or use Ajax? Anyway, post some HTML source on the result page would be helpful
thanks jessica
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
nisarkhan
Contributor
2402 Points
1472 Posts
Re: page_load event executing everytime
Jan 19, 2007 01:23 PM|LINK
Hi Jessica,
thanks for your reply.
yes you are correct i'm using custom control that uses javascript and ajax to do auto-complete feature and i did a full search on my application and i dont find anything "__doPostBack"
how do i find or is there a way i can debug to know what cause the postback or i should say, is there a way to prevent the post back? :)
thanks again.
--------------------------
Don't forget to click "Mark as Answer" on the post(s) that helped you.