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

selectedvalue postback problem

I've a problem with selectedvalue from a dropdownlist. I've migrated a web
page from asp.net 1.1 to 2.0. Everything worked fine in asp.net 1.1.

When postback occurs, no values left in the dropdownlist : selectedvalue =
nothing, itemcollection is empty.

Enableviewstate is true for the ddl and all the parents of the ddl.
Databinding is conditioned with 'if not page.ispostback'

I really don't understand where is the problem. I made another web migration
from 1.1 to 2.0 with another web page and in this case everything works
fine.

If someone have an idea, i'm really really really interested because i've
searched the solution for this day long. :-((

Thanks, in advance !

--
Bernard
be***********@odysseos.net
Jul 4 '07 #1
3 1986
Paste some code
--
Milosz
"Bernard Borsu" wrote:
I've a problem with selectedvalue from a dropdownlist. I've migrated a web
page from asp.net 1.1 to 2.0. Everything worked fine in asp.net 1.1.

When postback occurs, no values left in the dropdownlist : selectedvalue =
nothing, itemcollection is empty.

Enableviewstate is true for the ddl and all the parents of the ddl.
Databinding is conditioned with 'if not page.ispostback'

I really don't understand where is the problem. I made another web migration
from 1.1 to 2.0 with another web page and in this case everything works
fine.

If someone have an idea, i'm really really really interested because i've
searched the solution for this day long. :-((

Thanks, in advance !

--
Bernard
be***********@odysseos.net
Jul 4 '07 #2
Portion of code in the aspx page :
....
<tr>

<td class="C1">

<asp:Literal ID="oLLieuRepos" EnableViewState="False" Runat="server" />

<br>

<asp:DropDownList ID="oLieuRepos" Width="90%" Runat="server" />

</td>

<td class="C2">

<asp:Literal ID="oLHLieuRepos" EnableViewState="False" Runat="server" />

</td>

</tr>

.....

Portion of code in the codebehind file :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

If Page.IsPostBack Then

Dim nI As Integer

For nI = 1 To oNCS.Value

NouveauBlocConjoint(nI)

Next

Else

oLieuRepos.DataTextField = "Fune_NomLocalise"

oLieuRepos.DataValueField = "Fune_Id"

oPage.BD.Charge(IIf(lPFGP, "Proc_OPFunerariumsEPF", "Proc_FunerariumsEPF"),
oLieuRepos, New SqlParameter("@EPF", Utilisateur()))

End If

End Sub

Charge() is my own function executing SQL request dans binding data in the
DDL.

"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.pla écrit dans le message
de news: 5F**********************************@microsoft.com...
Paste some code
--
Milosz
"Bernard Borsu" wrote:
>I've a problem with selectedvalue from a dropdownlist. I've migrated a
web
page from asp.net 1.1 to 2.0. Everything worked fine in asp.net 1.1.

When postback occurs, no values left in the dropdownlist : selectedvalue
=
nothing, itemcollection is empty.

Enableviewstate is true for the ddl and all the parents of the ddl.
Databinding is conditioned with 'if not page.ispostback'

I really don't understand where is the problem. I made another web
migration
from 1.1 to 2.0 with another web page and in this case everything works
fine.

If someone have an idea, i'm really really really interested because i've
searched the solution for this day long. :-((

Thanks, in advance !

--
Bernard
be***********@odysseos.net

Jul 4 '07 #3
Another information :

When the dropdownlist is statis, so defined in the aspx page, no problem on
the postback.
This problem occurs only when the dropdownlist is filled dynamically by a
SQL request in the codebehind file.

"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.pla écrit dans le message
de news: 5F**********************************@microsoft.com...
Paste some code
--
Milosz
"Bernard Borsu" wrote:
>I've a problem with selectedvalue from a dropdownlist. I've migrated a
web
page from asp.net 1.1 to 2.0. Everything worked fine in asp.net 1.1.

When postback occurs, no values left in the dropdownlist : selectedvalue
=
nothing, itemcollection is empty.

Enableviewstate is true for the ddl and all the parents of the ddl.
Databinding is conditioned with 'if not page.ispostback'

I really don't understand where is the problem. I made another web
migration
from 1.1 to 2.0 with another web page and in this case everything works
fine.

If someone have an idea, i'm really really really interested because i've
searched the solution for this day long. :-((

Thanks, in advance !

--
Bernard
be***********@odysseos.net

Jul 5 '07 #4

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

Similar topics

3
by: MrMike | last post by:
Hello. I have the following code on an ASP webform that formats a dropdownlist named ddlCustomer... 'Populate ddlCustomer Dim CustAdapter As New SqlDataAdapter("SELECT * FROM lkup_Customers",...
5
by: John O'Donnell | last post by:
Hello on my asp.net code I load up a listbox on the page_load method. The problem is that while the items I have added in the page_load do appear when i run the page, i am unable to get the...
3
by: Ben Dewey | last post by:
Hey everyone, I have a wierd issue i can't seem to find out whats going on. I have a Control for a Shopping Cart Merchant Page called OrderStatus.ascx Inside that control there is a Repeater...
1
by: Charlie | last post by:
Hi: I noticed that after setting SelectedValue of a dropdownlist to have an item selected in list, if you reselect the same item later, it will not postback. In most cases I can see that this...
0
by: Pablo | last post by:
Hi at all! I have a problem (what's new! :P). I have two dropDown and two ODS. The dropDown filter each other at postback. When I select an item of the first DD, it fire a postback and filter...
4
by: Dooman | last post by:
Hello, I am getting this error when binding a drop down list box to a dataset: The 'SelectedIndex' and 'SelectedValue' attributes are mutually exclusive I have looked at other posts and...
3
by: Bart | last post by:
Hi, This code sends back the selectedvalue of a dropdownlist to itself (postabck). But the value (dd in the code) is empty. I must say: it works with EnableViewState="true". My question is:...
18
by: Redhairs | last post by:
Is it possible to get DropDownList.SelectedValue in Page_PreInit() event during the postback?
1
by: Brett | last post by:
I have a DropDownList in an ASP.NET web form that is populated with items from a lookup table by binding that DropDownList to a SqlDataSource. However, the items in the lookup table can change over...
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: 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
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...
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...

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.