Advertisement

03.05.2008 at 09:29AM PST, ID: 23216775
[x]
Attachment Details

How to update data in a Repeater row-by-row using old-fashion asynch CallBacks

Asked by jgroetch in Visual Studio 2008, C# Programming Language, Visual Studio .NET 2005

Tags: asp.net 3.5 with C#, IE 7

In my application I hook into the ICallbackEventHandler to make pre-asp.net 3.0 aynch callbacks. This callback is limited to a very simple area of an order input screen, which I used mostly to experiement with callbacks; and as a result, the code ended up working so I kept it.
Now, I'd like to experiment with Ajaxifying my Repeater object. I currently use the UpdatePanel, but I am not satisified because it freezes the links and controls that exist within the UpdatePanel. I understand it works that way because everything inside the UpdatePanel is getting refreshsed.
As a result, I would like to experiment with using that old-fasion CallBack code to update each row in my Repeater object one-by-one. However, I need some ideas on how the asynch callback can be called by each row in my repeater.
For example, here's a simple javascript function called ProcessText (called by another js function that was triggered by a OnBlur() on some text fields.

function processText()
{    
    var objCur1Amt     = document.getElementById(txtQuoteCur1AmtID);
    var objCur2Amt     = document.getElementById(txtQuoteCur2AmtID);
    callserver(objCur1Amt.value + ";" + objCur2Amt.value);
}

// come back from the server side event
function ReceiveServerData(arg, context)
{
    FormatBuySell(arg);
}

function FormatBuySell(arg){
    argArray = arg.split(";");  
    var objCur1Amt     = document.getElementById(txtQuoteCur1AmtID);
    var objCur2Amt     = document.getElementById(txtQuoteCur2AmtID);
    objCur1Amt.value = argArray[0].toString();
    objCur2Amt.value = argArray[1].toString();
}

Here's part of the repeater on my aspx page:

<asp:Repeater ID="Repeater1" ... >
<ItemTemplate>
    <tr align="center" id="trTagOrder"  runat="server" >  
     <td id="tdBuySell">
        <asp:Label ID="lblBuySell" Text='<% #Eval("buy_sell") %>' runat="server" ></asp:Label>
     </td>
    .
    .
    </tr>
    </ItemTemplate>    
    </asp:Repeater>

On the server side Repeater1_ItemDataBound event I can get a handle on each <tr> object as follows :

   HtmlTableRow tr = (HtmlTableRow)e.Item.FindControl("trTagOrder");

then I can use something like tr.BgColor = myColor in order to update the row's background color, for example.

This all works great but I'd like to figure out how to do this row-by-row WITHOUT leaving it up to the UpdatePanel to do the work for me.

Any ideas ?
Thank you sincerely,
BobStart Free Trial
[+][-]03.05.2008 at 10:58AM PST, ID: 21053248

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2008 at 11:17AM PST, ID: 21053417

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.05.2008 at 11:36AM PST, ID: 21053586

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2008 at 01:44PM PST, ID: 21054854

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.05.2008 at 02:01PM PST, ID: 21055028

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 06:44AM PST, ID: 21060590

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 06:54AM PST, ID: 21060663

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 07:37AM PST, ID: 21061191

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 08:33AM PST, ID: 21061959

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 09:18AM PST, ID: 21062530

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 09:28AM PST, ID: 21062641

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 09:45AM PST, ID: 21062835

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 12:36PM PST, ID: 21064460

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 02:14PM PST, ID: 21065353

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio 2008, C# Programming Language, Visual Studio .NET 2005
Tags: asp.net 3.5 with C#, IE 7
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628