473,320 Members | 1,957 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.

HTMLGenericControls, ascx, and span

Sue
I have created a web user control containing a web calendar (among other
controls) that is shown/hidden when the user clicks an imagebutton. I've used
SPAN tags to show/hide the calendar. I need to use several instances of this
user control in my main web page. What I need how is way to give the SPAN tag
an unique identifier for each instance of the user control so I can use
client-side code to show/hide the right instance of the web calendar without
making a trip to the server and back. I'm not quite getting all the pieces in
place using the HTMLGenericControl to make this work. Any suggestions?

tia,
Sue
Nov 19 '05 #1
3 4144
Hi Sue,

How about embedding the calendar in a Panel control? That will wrap it in a
Div that you can use much like the Span.

You can calculate the ID fairly well this way. Some code below. Let us know
if this helps?

Ken
Microsoft MVP [ASP.NET]
usrcalendar.ascx

<asp:Panel id="Panel1" runat="server"><asp:Calendar id="Calendar1"
runat="server"></asp:Calendar></asp:Panel>

usecalendar.aspx

<form id="Form1" method="post" runat="server">
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
<P>
<uc1:usrcalendar id="Usrcalendar1" runat="server"></uc1:usrcalendar>
<uc1:usrcalendar id="Usrcalendar2" runat="server"></uc1:usrcalendar>
<uc1:usrcalendar id="Usrcalendar3" runat="server"></uc1:usrcalendar></P>
</form>

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", _
"document.all.Usrcalendar2_Panel1.style.visibility =" & _
"'hidden';return false;")
End Sub

"Sue" <Su*@ojd.state.or.us> wrote in message
news:56**********************************@microsof t.com...
I have created a web user control containing a web calendar (among other
controls) that is shown/hidden when the user clicks an imagebutton. I've
used
SPAN tags to show/hide the calendar. I need to use several instances of
this
user control in my main web page. What I need how is way to give the SPAN
tag
an unique identifier for each instance of the user control so I can use
client-side code to show/hide the right instance of the web calendar
without
making a trip to the server and back. I'm not quite getting all the pieces
in
place using the HTMLGenericControl to make this work. Any suggestions?

tia,
Sue

Nov 19 '05 #2
Sue
Ken, thank you - worked just fine. Never thought to use panels in lieu of
spans.

Thanks!
Sue

"Ken Cox [Microsoft MVP]" wrote:
Hi Sue,

How about embedding the calendar in a Panel control? That will wrap it in a
Div that you can use much like the Span.

You can calculate the ID fairly well this way. Some code below. Let us know
if this helps?

Ken
Microsoft MVP [ASP.NET]
usrcalendar.ascx

<asp:Panel id="Panel1" runat="server"><asp:Calendar id="Calendar1"
runat="server"></asp:Calendar></asp:Panel>

usecalendar.aspx

<form id="Form1" method="post" runat="server">
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
<P>
<uc1:usrcalendar id="Usrcalendar1" runat="server"></uc1:usrcalendar>
<uc1:usrcalendar id="Usrcalendar2" runat="server"></uc1:usrcalendar>
<uc1:usrcalendar id="Usrcalendar3" runat="server"></uc1:usrcalendar></P>
</form>

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", _
"document.all.Usrcalendar2_Panel1.style.visibility =" & _
"'hidden';return false;")
End Sub

"Sue" <Su*@ojd.state.or.us> wrote in message
news:56**********************************@microsof t.com...
I have created a web user control containing a web calendar (among other
controls) that is shown/hidden when the user clicks an imagebutton. I've
used
SPAN tags to show/hide the calendar. I need to use several instances of
this
user control in my main web page. What I need how is way to give the SPAN
tag
an unique identifier for each instance of the user control so I can use
client-side code to show/hide the right instance of the web calendar
without
making a trip to the server and back. I'm not quite getting all the pieces
in
place using the HTMLGenericControl to make this work. Any suggestions?

tia,
Sue


Nov 19 '05 #3
Glad to help!

Ken

"Sue" <Su*@ojd.state.or.us> wrote in message
news:BA**********************************@microsof t.com...
Ken, thank you - worked just fine. Never thought to use panels in lieu of
spans.

Thanks!
Sue

"Ken Cox [Microsoft MVP]" wrote:
Hi Sue,

How about embedding the calendar in a Panel control? That will wrap it in
a
Div that you can use much like the Span.

You can calculate the ID fairly well this way. Some code below. Let us
know
if this helps?

Ken
Microsoft MVP [ASP.NET]
usrcalendar.ascx

<asp:Panel id="Panel1" runat="server"><asp:Calendar id="Calendar1"
runat="server"></asp:Calendar></asp:Panel>

usecalendar.aspx

<form id="Form1" method="post" runat="server">
<P>
<asp:Button id="Button1" runat="server"
Text="Button"></asp:Button></P>
<P>
<uc1:usrcalendar id="Usrcalendar1" runat="server"></uc1:usrcalendar>
<uc1:usrcalendar id="Usrcalendar2" runat="server"></uc1:usrcalendar>
<uc1:usrcalendar id="Usrcalendar3"
runat="server"></uc1:usrcalendar></P>
</form>

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", _
"document.all.Usrcalendar2_Panel1.style.visibility =" & _
"'hidden';return false;")
End Sub

"Sue" <Su*@ojd.state.or.us> wrote in message
news:56**********************************@microsof t.com...
>I have created a web user control containing a web calendar (among other
> controls) that is shown/hidden when the user clicks an imagebutton.
> I've
> used
> SPAN tags to show/hide the calendar. I need to use several instances of
> this
> user control in my main web page. What I need how is way to give the
> SPAN
> tag
> an unique identifier for each instance of the user control so I can use
> client-side code to show/hide the right instance of the web calendar
> without
> making a trip to the server and back. I'm not quite getting all the
> pieces
> in
> place using the HTMLGenericControl to make this work. Any suggestions?
>
> tia,
> Sue


Nov 19 '05 #4

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

Similar topics

1
by: Quentin | last post by:
hey there, ok i made a class, that inherits webcontrol, and i add an htmltable to it. I was wondering how to declare an ascx file as an object in my class, like that i could change the content...
4
by: Rob Meade | last post by:
Hi all, I have just put together our organisations 'template' for our web applications and have created 7 .ascx files which when dropped into my template file work perfectly...however, I have a...
2
by: Wade Beasley | last post by:
I have a web project that currently has a standard header, footer, and menu ascx files. I am now suppose to change the project to allow a user to choose from 3 different views, ie 3 different...
1
by: John Cosmas | last post by:
I've got a page which loads up a different user control into a placeholder control every time a button is clicked on the parent page. I use a statement like...
1
by: xenophon | last post by:
I have a div area in my ASP.NET page template with this HTML in it: <iframe id="ifmContent" name="ifmContent" src="about:blank" frameborder="0"></iframe> I beleive this iframe is an...
6
by: tshad | last post by:
I have an ascx file I am using to include my logos and heading information for all my pages. It was working fine up until now. I decided to set up an admin folder inside of my main folder and...
6
by: Martin Eyles | last post by:
Hi, I have a .aspx page which has a .ascx file included through the lines <%@ Register TagPrefix="aspcustom" TagName="menu" Src="Menu.ascx" %> and <aspcustom:menu id="Menu1"...
2
by: Peter Kirk | last post by:
Hi I have an ascx (MainCalendarControl.ascx), which includes another ascx, by using this statement at the top of MainCalendarControl.ascx: Register TagPrefix="CalendarUI"...
3
by: Steven Nagy | last post by:
Hi all, ASP.NET : Framework 2.0 - C# A recent addition to my code generater will create GridView's and ObjectDataSource's in a control (ASCX). So the code gen creates an ascx, ascx.cs,...
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
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
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

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.