473,320 Members | 1,858 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,320 software developers and data experts.

User Control Problem

Hi All,

I have created a web user control. This control mimics the numeric pagers
seen on many online bookstores. I made this user control using the
Repeater. It is populated dynamically. Here's my code for its
presentation:

<asp:Repeater id="Repeater1" enableviewstate="False" runat="server">
<HeaderTemplate><div id="pager"></HeaderTemplate>
<ItemTemplate><a href='<%# DataBinder.Eval(Container, "DataItem.Number",
"Results.aspx?page={0}") %>'
runat="server"><%# DataBinder.Eval(Container, "DataItem.Number")
%></a></ItemTemplate>
<FooterTemplate></div></FooterTemplate>
</asp:Repeater>

Using its code-behind file, the control is bound to the data of choice.
When this control is placed on a webform, it does as expected. Everything
works fine and dandy.

However, when I click on one of the anchors, I'd like the selected anchor's
href property to be empty (to prevent further clicking on it until another
anchor is selected). I've noticed that settting the href property to "" or
"#" still allows the anchor to be clicked. This is the only functionality
that is missing from my user control. Could someone please tell me how to
accomplish this?

Thanks,
Roshawn

Nov 18 '05 #1
1 2033
I'm not sure what your question is.
Do you want the the hyper link not to be clickable so that the user can't
request the page again while the page is reloading?
To do this you have to write some javascript function that takes the page as
a parameter, reload the page with that parmeter and sets some flag which is
checked if the funciton is called again-

hope this helps,
mortb

"Roshawn" <ud****@bellsouth.net> wrote in message
news:eb**************@TK2MSFTNGP11.phx.gbl...
Hi All,

I have created a web user control. This control mimics the numeric pagers
seen on many online bookstores. I made this user control using the
Repeater. It is populated dynamically. Here's my code for its
presentation:

<asp:Repeater id="Repeater1" enableviewstate="False" runat="server">
<HeaderTemplate><div id="pager"></HeaderTemplate>
<ItemTemplate><a href='<%# DataBinder.Eval(Container, "DataItem.Number", "Results.aspx?page={0}") %>'
runat="server"><%# DataBinder.Eval(Container, "DataItem.Number")
%></a></ItemTemplate>
<FooterTemplate></div></FooterTemplate>
</asp:Repeater>

Using its code-behind file, the control is bound to the data of choice.
When this control is placed on a webform, it does as expected. Everything
works fine and dandy.

However, when I click on one of the anchors, I'd like the selected anchor's href property to be empty (to prevent further clicking on it until another
anchor is selected). I've noticed that settting the href property to "" or "#" still allows the anchor to be clicked. This is the only functionality
that is missing from my user control. Could someone please tell me how to
accomplish this?

Thanks,
Roshawn

Nov 18 '05 #2

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

Similar topics

1
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
2
by: Sam Kuehn | last post by:
There has been a lot of articles on how to load user controls at runtime in the Init() method. UserControl myControl = (UserControl)LoadControl(stringControl); I add the control in the Init()...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
4
by: thomson | last post by:
Hi all, i do have a user control with 4 buttons, and all the events are firing properly, My problem is that i need to right an event handler in the user control, which gets fired after a...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
3
by: jonathan.beckett | last post by:
I have been experimenting with placing user controls (using Windows Forms controls) into an ASP.NET webpage - and am completely stuck. I can get a blank user control to work, but nothing beyond...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.