Hi,
I've an aspx page which has got a textbox and a submit button.Entering data in the textbox and hitting the button shows a listview control which displays data retrived from the database.Listvew has sorting,pagination,edit functionalities. For each of these,the corresponding method is triggered on the server side...for example: lv_sorting lv_Edit etc. If the user types in data in the textbox and hits enter key, Page.IsPostback is returned as false in IE browsers but is returned as true in Firefox(any idea, why is this so?).
When postback is true,the corresponding method gets called ie. lv_sorting etc. But since in Page_Load event,am only pulling data from the database when postback is false, page does not show any data in firefox browser.
I need to show data in listview when enter key is pressed in firefox browsers. I tried using DefaultButton="submitBtnId" and also forcefully invoking button click when enter key is pressed in the textbox,but no luck.
Thanks.
FYI, here is the javascript code that gets called when enter key is pressed in the textbox:
function clickButton(e, buttonid) {
var bt = document.getElementById(buttonid);
if (typeof bt == 'object') {
if (navigator.appName.indexOf("Netscape") > (-1)) {
if (e.keyCode == 13) {
if (bt && typeof (bt.click) == 'undefined') {
bt.click = addClickFunction1(bt)
}
}
}
if (navigator.appName.indexOf("Microsoft Internet Explorer") > (-1)) {
if (event.keyCode == 13) {
bt.click();
return false;
}
}
}
}
function addClickFunction1(bt) {
var result = true;
if (bt.onclick) result = bt.onclick();
if (typeof (result) == 'undefined' || result) {
eval(bt.href);
}
}