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(tx
tQuoteCur1
AmtID);
var objCur2Amt = document.getElementById(tx
tQuoteCur2
AmtID);
callserver(objCur1Amt.valu
e + ";" + 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(tx
tQuoteCur1
AmtID);
var objCur2Amt = document.getElementById(tx
tQuoteCur2
AmtID);
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.FindC
ontrol("tr
TagOrder")
;
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,
Bob
Start Free Trial