473,387 Members | 1,520 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,387 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 2036
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.