Events fired on localhost, not on remote machine

G

Guest

Hi,

I have a asp.net application in which there is a listbox and a button. When
the user selects an item and presses a button, I want to get the
selectedindex of the item. This application works fine when built and run on
localhost.

I copy the same project on a remote machine, open the project remotely from
my local machine, build it from my local machine to the bin folder on the
remote machine. When I run the same code on the remote machine, listbox
selectedindexchanged event does not fire, and the selectedindex is always -1,
moreover the items in the listbox are lost.

It has been days and I cannot resolve this issue, I'll appreciate any help.

Thanks in advance,
Bilge Gul
 
J

Jc Morin

Hi Bilge,

This seems like a viewstate issue. Did you check if the Web.Config or
Machine.Config files have disabled the viewstate?

The event of dropdown cannot be fire if the control do not have viewstate
[The event is fired if the posted value is different from the previous
values stored in the viewstate]. It is also a side effect to loose all data
after a postback.
 
G

Guest

Yes this solved the problem:) Previously I was checking the web.config file
in my virtual directory and was not able to find anything in it related to
the viewstate. Then I searched all web.config files under the inetpub\wwwroot
and there was one exactly in inetpub\wwwroot which contained a
enableviewstate=false directive. So I added the same line to my own virtual
directory but this time with enableviewstate=true. And now I can catch the
events and get selectedIndex:))

Jc Morin said:
Hi Bilge,

This seems like a viewstate issue. Did you check if the Web.Config or
Machine.Config files have disabled the viewstate?

The event of dropdown cannot be fire if the control do not have viewstate
[The event is fired if the posted value is different from the previous
values stored in the viewstate]. It is also a side effect to loose all data
after a postback.

--------------------------
Jean-Claude Morin, MCP
Software Developer
2k1Soft/kCentric, Canada


b_gul_t said:
Hi,

I have a asp.net application in which there is a listbox and a button. When
the user selects an item and presses a button, I want to get the
selectedindex of the item. This application works fine when built and run on
localhost.

I copy the same project on a remote machine, open the project remotely from
my local machine, build it from my local machine to the bin folder on the
remote machine. When I run the same code on the remote machine, listbox
selectedindexchanged event does not fire, and the selectedindex is always -1,
moreover the items in the listbox are lost.

It has been days and I cannot resolve this issue, I'll appreciate any help.

Thanks in advance,
Bilge Gul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top