Mohammed Atef’s Technical blog

Using JavaScript with RadAjaxPanel

Today I was working in some stuff for using collapsible +, – operators to show and hide RadAjaxPanel. I will tell you the business scenario and the problem I have faced and how it was solved to share this knowledge with you.
Business Scenario
I have one user control contain RadAjaxPanel control and two images one for + operator and the second for minus operator. And I was using this user control into default.aspx page. I am trying to develop simple JavaScript staff for showing the RadAjaxPanel if I clicked + image and hide it if I clicked – image.
Problems and solutions

1- JavaScript I have added not working why???
this because I must set RadAjaxPanel property named EnableOutsideScripts=true;
and add this javascript code into my page.

2- How to hide one of the two images when page loaded?
I did the normal coding I just set the image control property visible=flase;
but it is not working I receive JavaScript error:’ image name’ object not found.why???!!!!!!

3- How to hide any server control without errors in JavaScript using C# code?
to hide server control using C# code without any JavaScript error.you can set the display property to none from code like ‘ControlName’.Style[“display”] = “none”;

4- Can I use style.display for RadAjaxPanel?

No you cannot use style.display into RadAjaxPanel because it does not has style object. so you need to add this RadAjaxPanel into and container like div control and set it’s style.display.

Now all functionality is working fine.
I hope this help.

Advertisements

June 15, 2009 - Posted by | Asp.net, Developement | , ,

2 Comments »

  1. “1- JavaScript I have added not working why???
    this because I must set RadAjaxPanel property named EnableOutsideScripts=true;
    and add this javascript code into my page.”

    i did it, and still not working!! any idea?

    Comment by ozzy | November 5, 2009 | Reply

  2. This may be something else not related to Ajax panel if you can send you web page it will be fine

    Comment by mohammedatef83 | November 6, 2009 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: