473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why doesn't this ATLAS/AJAX code work???

I have an aspx page where I have a repeater control that repeats a asp:LinkButton. When I click on one of the links, I get a post back, and the page flashes. A friend told me to look into ATLAS/AJAX, but didn't go into much detail.

From what I read/gathered, I came up with this code:

<asp:SqlDataSource ID="dsCategories" runat="server" ConnectionString="<%$ ConnectionStrings:cstrDataSource %>" SelectCommand="SELECT [CategoryID], [Name] FROM [tblCategories] ORDER BY [Name]">
</asp:SqlDataSource>

<asp:Repeater ID="rptCategories" runat="server" DataSourceID="dsCategories">

<ItemTemplate>

<atlas:UpdatePanel ID="pnlCategories" mode="Conditional">
<Content>
<asp:LinkButton ID="lnkCategories" runat="server" Visible="true" Style="font-weight: bold; font-size: 10pt; color: black; font-family: Arial; text-decoration: none"
OnClick="rptCategories_OnClick" Text = '<%# DataBinder.Eval(Container.DataItem, "Name") %>'
/>
<br />
</Content>

<Triggers>
<atlas:ControlEventTrigger ControlID="lnkCategories" EventName="Click"/>
</Triggers>

</atlas:UpdatePanel>

</ItemTemplate>

</asp:Repeater>

so I have a repeater control, and inside the item template, I put the link button inside of an update panel, but this doesn't seem to stop the flashing at all, although it is calling rptCategories_OnClick... what am I doing wrong?

Thanks.

Nov 21 '06 #1
2 1718
Hi,
You need to put the whole repeater inside the content template of the update
panel and change the trigger to use the id of the repeater and the
ItemCommand Event of the repeater.
I'm sending a working version of the code uoy supplied, but it's modified to
work on the ASP.NET Ajax Beta 2
<asp:SqlDataSource ID="dsCategories" runat="server" ConnectionString="<%$
ConnectionStrings:TVETConnectionString %>" SelectCommand="SELECT
[AccreditationLevelID], [AccreditationLevelName] FROM [AccreditationLevels]">
</asp:SqlDataSource>
<asp:UpdatePanel ID="pnlCategories" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Repeater ID="rptCategories" runat="server" DataSourceID="dsCategories" >

<ItemTemplate>

<asp:LinkButton ID="lnkCategories" runat="server" Visible="true"
Style="font-weight: bold; font-size: 10pt; color: black; font-family: Arial;
text-decoration: none"
OnClick="rptCategories_ItemCommand" Text = '<%#
Eval("AccreditationLevelName") %>'
/>
<br />

</ItemTemplate>

</asp:Repeater>
</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID="rptCategories" />
</Triggers>
</asp:UpdatePanel>

Regards,
Mohamed Mosalem

"Nobody" wrote:
I have an aspx page where I have a repeater control that repeats a asp:LinkButton. When I click on one of the links, I get a post back, and the page flashes. A friend told me to look into ATLAS/AJAX, but didn't go into much detail.

From what I read/gathered, I came up with this code:

<asp:SqlDataSource ID="dsCategories" runat="server" ConnectionString="<%$ ConnectionStrings:cstrDataSource %>" SelectCommand="SELECT [CategoryID], [Name] FROM [tblCategories] ORDER BY [Name]">
</asp:SqlDataSource>

<asp:Repeater ID="rptCategories" runat="server" DataSourceID="dsCategories">

<ItemTemplate>

<atlas:UpdatePanel ID="pnlCategories" mode="Conditional">
<Content>
<asp:LinkButton ID="lnkCategories" runat="server" Visible="true" Style="font-weight: bold; font-size: 10pt; color: black; font-family: Arial; text-decoration: none"
OnClick="rptCategories_OnClick" Text = '<%# DataBinder.Eval(Container.DataItem, "Name") %>'
/>
<br />
</Content>

<Triggers>
<atlas:ControlEventTrigger ControlID="lnkCategories" EventName="Click"/>
</Triggers>

</atlas:UpdatePanel>

</ItemTemplate>

</asp:Repeater>

so I have a repeater control, and inside the item template, I put the link button inside of an update panel, but this doesn't seem to stop the flashing at all, although it is calling rptCategories_OnClick... what am I doing wrong?

Thanks
Nov 21 '06 #2

"Mohamed Mosalem" <Mo************@discussions.microsoft.comwrote in
message news:75**********************************@microsof t.com...
Hi,
You need to put the whole repeater inside the content template of the
update
panel and change the trigger to use the id of the repeater and the
ItemCommand Event of the repeater.
I'm sending a working version of the code uoy supplied, but it's modified
to
work on the ASP.NET Ajax Beta 2
Thanks, I got it working now... I think through out my moving code around to
get it working, that was one of the things I tried.. so that was one
issue... but the bigger issue was that I didn't put all the junk inside the
web config to enable ajax. Wasn't aware you had to do that til I noticed an
error on the IE status bar.
Nov 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: needin4mation | last post by:
I understand this is a asp.net group, but thought I would post this here for comments. I admit I have used this post in another group, but it has less traffic. Here's to hoping I'm just blind to...
8
by: darrel | last post by:
I'm going to be diving into ASP.net 2.0 on a small project. I'd also like to use it as an excuse to start playing with some AJAX techniques. So, that leads to the obvious question: AJAX.net vs....
5
by: Papanii Okai | last post by:
Hi Guys, As we wall know Atlas is a fairly new feature everyone is talking about (atleast at my school). Even though the idea of Ajax has been used in the past i was wondeing if anyone could...
5
by: geekboy0001 | last post by:
Just trying to get some opinions out there... There are tons of Ajax libraries out there... Ajax.NET Professional, ComfortASP.NET, ZumiPage, etc. etc... Microsoft has their own too, Atlas. I've...
2
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder....
1
by: MPA | last post by:
Hi, I am a newbee to web applications and we are planning to rewrite our existing PowerBuilder client-server application into a web application under Visual Studio .Net 2005. My question is...
5
by: igotyourdotnet | last post by:
I have a question on atlas: I can create an 'atlas project' and I can add atlas controls fine. but when I try and add an atlas control to an existing asp.net web app I can't, Why? I did notice...
4
by: s.bussing | last post by:
Hi All, I'm new to Atlas and I did some programming using AJAX, but I'm wondering if it is possible to hava a javascript which can call a server-site function, in my case to write data to the...
3
by: =?Utf-8?B?UGFycm90?= | last post by:
I applied the following Ajax code in my web page which has a calendar control to keep my page from completely reloading everytime something was changed. <atlas:ScriptManager ID="ScriptManager1"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.