SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i am using web farm solution and i have implemented few custom properties and my question is, is there a way i can enabled AJAX? when the user enter the bad name i validate in the prop and display error and its all working fine but it postback (repainting) the page.

private string _listName;
        [WebBrowsable(true), WebDisplayName("List Name"),   WebDescription("Enter ~ Separated List Name to Show Data Here.."),   Personalizable(PersonalizationScope.Shared),   System.ComponentModel.Category("Settings"),   System.ComponentModel.DefaultValue("")]
        public string ListName
            get { return _listName; }
                if (string.IsNullOrEmpty(_listName))
                    throw new WebPartPageUserException("Please enter atleast one List Name here...");
                    _listName = value;
share|improve this question
up vote 1 down vote accepted

Are you just wanting the webpart to repaint or some other part of the page?

If it's just your own webpart, then you can do one of two things.

  1. Add an update panel to your webpart and then put all of your controls in the update panel. This is probably the easiest but does have a lot of overhead and there is some complexity if you have multiple ones on the page.

  2. You could have your webpart implement ICallbackEventHandler. From here you can do an ajax call and that call will return a string. Then on the client side in JavaScript, you take that string that is returned and use it to update the html in your webpart using the dom. This solution is harder to impliment, but has less overhead.

share|improve this answer
have you done the option #1 and do you have sample code for that? – Nick Kahn Sep 2 '11 at 18:09
I have, unfortunately the code is too much to post here. A quick google search revealed a blog which shows you how to implement an update panel in a SharePoint webpart:… – Steve Lineberry Sep 2 '11 at 18:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.