Home All Groups Group Topic Archive Search About
Author
14 Apr 2006 6:19 AM
nirbhay
Hello All

I am having a problem with one of my aspx pages using DataList.
I will try to make it very short and precise :)

~~ The List is data bound on page load(!IsPostBack) to a DataTable.
The page displays the list items all well and fine.
The DataList has an Edit Command button (in ItemTemplate)and an
EditItem template that has couple of TextBoxes and 2 Command buttons,
Update and Cancel.
When Edit Command button clicked, the page post backs and displays text
boxes with update and cancel button for that line item.

When i click Update button, its not getting fired AT ALL.
I can see the page postback but nothing on the UpdateCommand event
handler ???
I do all the necessary code on server side for the event handler
Like setting  the EditItemIndex on click of edit and calling
dataList.databound() method  etc etc.

Could anyone please let me know the missing piece?
Appreciate it

Thanks in advance
Cheers

--Nirbhay

Author
17 Apr 2006 12:14 PM
Teemu Keiski
Hi,

can you show relevant snippet of aspx and code?

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Show quoteHide quote
"nirbhay" <rms10***@yahoo.com> wrote in message
news:1144995579.828409.223250@i40g2000cwc.googlegroups.com...
> Hello All
>
> I am having a problem with one of my aspx pages using DataList.
> I will try to make it very short and precise :)
>
> ~~ The List is data bound on page load(!IsPostBack) to a DataTable.
> The page displays the list items all well and fine.
> The DataList has an Edit Command button (in ItemTemplate)and an
> EditItem template that has couple of TextBoxes and 2 Command buttons,
> Update and Cancel.
> When Edit Command button clicked, the page post backs and displays text
> boxes with update and cancel button for that line item.
>
> When i click Update button, its not getting fired AT ALL.
> I can see the page postback but nothing on the UpdateCommand event
> handler ???
> I do all the necessary code on server side for the event handler
> Like setting  the EditItemIndex on click of edit and calling
> dataList.databound() method  etc etc.
>
> Could anyone please let me know the missing piece?
> Appreciate it
>
> Thanks in advance
> Cheers
>
> --Nirbhay
>
Author
18 Apr 2006 5:44 AM
nirbhay
Hi Teemu

The problem is fixed now after i enabled the view state.
Thanks for your attention on this.

On a side note, i noticed that when my EditItem Template is invoked, it
refreshes my page and positions the cursor to the top of the page,
which is fine for a short list.
Lets say i click on the Edit command button on a list item at the
bottom half of the page,
it takes my cursor at the top of page and user has to scroll down to
look where he last clicked...
Is there a workaround to let browser remain positioned at the old
clicked position  ??

I would assume viewstate store such stats but looks like its not ???
Appreciate any help

Cheers

--Nirbhay
Author
22 Apr 2006 6:44 AM
Teemu Keiski
Hi,

in ASP.NEt 2.0 you'd had MaintainScrollPositionOnPostBack on Page but with
v1 there are many solutions

http://pascarello.brinkster.net/rememberScrollPosition.html
http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx
http://authors.aspalliance.com/aldotnet/examples/dgautoscroll.aspx

ViewState stores server-side state of the control, so it wouldn't know about
client-side positioning.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Show quoteHide quote
"nirbhay" <rms10***@yahoo.com> wrote in message
news:1145339081.438946.134040@i39g2000cwa.googlegroups.com...
> Hi Teemu
>
> The problem is fixed now after i enabled the view state.
> Thanks for your attention on this.
>
> On a side note, i noticed that when my EditItem Template is invoked, it
> refreshes my page and positions the cursor to the top of the page,
> which is fine for a short list.
> Lets say i click on the Edit command button on a list item at the
> bottom half of the page,
> it takes my cursor at the top of page and user has to scroll down to
> look where he last clicked...
> Is there a workaround to let browser remain positioned at the old
> clicked position  ??
>
> I would assume viewstate store such stats but looks like its not ???
> Appreciate any help
>
> Cheers
>
> --Nirbhay
>