Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Client side script for web part

  Asked By: Shauna    Date: Nov 22    Category: Sharepoint    Views: 1393

I am building a custom web part in SPS2003. I have a dropdownlist, on
which another list is populated. I have a handler for selectIndexChange
of dropDownList.The problem is that if i set autopostback for the
dropdown to be true, the portal page is reloaded causing all the other
web parts to be reloaded.
If I turn off the autoPostBack property, then the handler is not used.
Is there any method by which I can avoid the postback of the portal

Is it possible to write client side script for the dropDownlist?

Any tips/pointers?



1 Answer Found

Answer #1    Answered By: Aakash Gavade     Answered On: Nov 22

I had problems like this as well. I did a log of searching and found
that nothing would help. No matter what I did the event would fire
either twice or not at all.

What I did was to set  a simple counter in the procedure. (I use VB)

At the global level

' Init the counter
Dim DamnDoubleEvent as integer = 0

Private Function FuncitonBeingCalled(ByVal something as something)

If DamnDoubleClick > 0 then
Exit Function
DamnDoubleEvent = DamnDoubleEvent + 1
End if

It's not pretty, and there may be a better way, but it works.

Didn't find what you were looking for? Find more on Client side script for web part Or get search suggestion and latest updates.