iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > .NET

Reply
 
LinkBack (1) Thread Tools
Old September 8th, 2008, 01:31 AM   1 links from elsewhere to this Post. Click to view. #1
New Member
 

Join Date: Aug 2008
Location: Australia
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Sam Horne is on a distinguished road
RegisterAsyncPostBackControl AJAX

Hi,

I'm using a datalist with an ImageButton that, when clicked, provides further information from database and displays it in a DetailsView and FormView. Because a video is playing at the same time, I need it to be AJAXified so that when an imagebutton is clicked in the datalist, the update panel updates asynchronously. I heard that you need to use RegisterAsyncPostBackControl to register each imagebutton as an async control, but I'm still having troubles because it keeps posting back whenever a button is click. I think that either I'm not provoking the method correctly, or its being provoked in the wrong place.

Thanks in advance.


C# Code:

Code:
 
protected void selectFrog_Click(object sender, CommandEventArgs e)
{
AccessDataSource AccessDataSource1 = new AccessDataSource();
AccessDataSource1.DataFile = "~/App_Data/EMS1.mdb";
AccessDataSource1.SelectCommand = "SELECT * FROM [SpeciesFrog] WHERE ([FrogID] = " + e.CommandArgument.ToString() + ")";
AccessDataSource1.ID = "AccessDataSource1";
FormView1.DataSource = AccessDataSource1;
FormView1.DataBind();
DetailsView1.DataSource = AccessDataSource1;
DetailsView1.DataBind();
DataList1.DataBind();
this.UpdatePanel1.Update();
}
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
ImageButton imgButton = (ImageButton)e.Item.FindControl("FrogThumb");
ScriptManager1.RegisterAsyncPostBackControl(imgButton);
int i = ScriptManager1.Controls.Count;
}
Sam Horne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 10th, 2008, 10:09 PM   #2
New Member
 

Join Date: Aug 2008
Location: Australia
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Sam Horne is on a distinguished road
Re: RegisterAsyncPostBackControl AJAX

I see lots of views but no suggestions!

An update: I'm thinking about scrapping the detailsview / formview and making it pop up in a seperate window. Good idea?
Sam Horne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 23rd, 2008, 03:06 PM   #3
New Member
 

Join Date: Sep 2008
Location: 1
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 tuvw236 is on a distinguished road
so boring.have a funy with everyone

A father and son snake are out for a nice afternoon slither. The son asks, "Dad,are we poisonous snakes?" The father replies proudly, "Yes son, we are rattler snakes! Why do you ask son?" "Because DAD, I just bit my tongue!!" ------------------------------------------------------------signature: Sexy Lingerie WholesaleBallroom Dance Dress
tuvw236 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


LinkBacks (?)
LinkBack to this Thread: http://webforumz.com/net/70469-registerasyncpostbackcontrol-ajax.htm
Posted By For Type Date
RegisterAsyncPostBackControl AJAX This thread Refback September 17th, 2008 08:43 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Help alexgeek JavaScript 3 October 16th, 2007 03:04 AM
What is Ajax? Daniel Other Languages 17 April 4th, 2007 10:50 AM
Ajax Messages (Ajax Demonstration) iMarc JavaScript 1 March 21st, 2007 07:48 PM
PHP AJAX HOW-TOs nuk PHP 1 January 5th, 2007 11:29 AM


Search Engine Optimization by vBSEO 3.2.0 RC8