473,383 Members | 1,877 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,383 software developers and data experts.

Auto postback problem with e.g. DropDownList

Hello,

I am in the process of making my asp.net form to validate as xhtml 1.0
strict. So far I am doing well, but now I have a problem. The problem
concerns specifically DropDownList and ListBox, but other controls
might result in the same problem.

When AutoPostBack is enabled on these controls, two hidden input fields
are created on the form (__EVENTTARGET and __EVENTARGUMENT),
furthermore a "postback" javascript is embedded, this javascript looks
something like this:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["MainForm"];
}
else {
theform = document.MainForm;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

My problem is that after I converted my forms to xhtml, this javascript
ceased to work. The error Im getting is: "__EVENTTARGET is null or not
an object". I suspect it has something to do with the fact that the
javascript does not conform to the proper syntax and grammar for
javascript in xhtml. As far as I have learned the proper way to access
a control is by using "document.getElementById" and not call it
directly. I can easily change the script to conform, but how do I
replace the one mentioned above?

So, my problem is: How do I retain the autopostback functionality on
e.g. DropDownList but prevents it from registering the javascript?

--
Thomas Due
Software Developer
Scanvaegt Nordic A/S
Posted with XanaNews version 1.16.3.1
Nov 18 '05 #1
0 1646

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

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
0
by: Thomas Due | last post by:
Hello, I am in the process of making my asp.net form to validate as xhtml 1.0 strict. So far I am doing well, but now I have a problem. The problem concerns specifically DropDownList and...
6
by: Olivier Matrot | last post by:
Hello, This has probably been asked several times, but It must be clarified for me. I would like to know why sometimes during a postback Page_Load is called after the function marked for...
6
by: Alan Silver | last post by:
Hello, I have a placeholder, which gets a user control added in when the page first loads. This user control contains a dropdownlist, and I would like to get hold of the value of this drop down...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
1
by: RSH | last post by:
Hi, I am experimenting with the Viewstate and based on a few articles I have read, I put together a test. it is a simple test where I am dynamically creating a DropDownList that contains 25000...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
3
by: Lohboy | last post by:
Using ASP.NET and IE7. (Sorry if I am posting in the wrong forum but my problem seemed to be more related to the JavaScript side than the ASP.NET side.) I have two DropDownList controls the...
8
by: Dan | last post by:
Hi, i experimented with postback and viewstate. With this code, there are 2 dropdownlists created, one visible and with AutoPostBack true, the other not visible and no AutoPostBack, and one...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.