473,623 Members | 3,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

user control, css, and redirect

I have a navigation user control navig.ascx that redirects to respective
pages based on webcontrols.lin kbutton clicks using response.redire ct.

I would like to control the look and feel of those link buttons. Once I
click the button, I would like to make it bold using instructions like

linkbutton.font .bold=true

This works as long as its NOT followed by response.redire ct

For example:

linkbutton.font .bold=true;
response.redire ct("mypage.aspx ");

if I take out the response line, this works, with response line in the code,
the instruction does get executed but some how link button does not get
bolded.
"mypage.asp x" does host navig.ascx user control as other navigated pages.

Please help.
Thanks
Trisha
Nov 19 '05 #1
5 2209
Trisha:
You are getting things confused.

You are setting the bold property of a control to true, then going to
another page. The control (linkbutton) doesn't survive through a
redirect...you create a new instance.....

If you want this boldedness value to survive postbacks and links you should
use the :visited attribute of CSS.
http://www.blooberry.com/indexdot/cs...assvisited.htm
<asp:linkbutt on id="x" runat="server" CssClass="someC lass" ... />

and your css should look like:

someClass:visit ed{
font-weight:bold;
}
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
I have a navigation user control navig.ascx that redirects to respective
pages based on webcontrols.lin kbutton clicks using response.redire ct.

I would like to control the look and feel of those link buttons. Once I
click the button, I would like to make it bold using instructions like

linkbutton.font .bold=true

This works as long as its NOT followed by response.redire ct

For example:

linkbutton.font .bold=true;
response.redire ct("mypage.aspx ");

if I take out the response line, this works, with response line in the
code,
the instruction does get executed but some how link button does not get
bolded.
"mypage.asp x" does host navig.ascx user control as other navigated pages.

Please help.
Thanks
Trisha

Nov 19 '05 #2
Karl,

When I apply this CssClass="someC lass" to all the linkbuttons on the ascx
page,
all the linkbuttons are bolded even though they are not clicked.

"Karl Seguin" wrote:
Trisha:
You are getting things confused.

You are setting the bold property of a control to true, then going to
another page. The control (linkbutton) doesn't survive through a
redirect...you create a new instance.....

If you want this boldedness value to survive postbacks and links you should
use the :visited attribute of CSS.
http://www.blooberry.com/indexdot/cs...assvisited.htm
<asp:linkbutt on id="x" runat="server" CssClass="someC lass" ... />

and your css should look like:

someClass:visit ed{
font-weight:bold;
}
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
I have a navigation user control navig.ascx that redirects to respective
pages based on webcontrols.lin kbutton clicks using response.redire ct.

I would like to control the look and feel of those link buttons. Once I
click the button, I would like to make it bold using instructions like

linkbutton.font .bold=true

This works as long as its NOT followed by response.redire ct

For example:

linkbutton.font .bold=true;
response.redire ct("mypage.aspx ");

if I take out the response line, this works, with response line in the
code,
the instruction does get executed but some how link button does not get
bolded.
"mypage.asp x" does host navig.ascx user control as other navigated pages.

Please help.
Thanks
Trisha


Nov 19 '05 #3
That's because those links have been visited in the past, which is how the
:visited pseudo-css-class works.

It dawns on me that you want the link to be bolded for the new page the user
is on to indicate to the user that this is the page you are on. In other
words, you want it bolded once and only once.

To do so, you should make the navigation control self-aware of what page it
is on and which linkbutton to bold. You shouldn't do it on the eventhandler
of the linkbutton click, but rather on the page_load of the user control.

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:7A******** *************** ***********@mic rosoft.com...
Karl,

When I apply this CssClass="someC lass" to all the linkbuttons on the ascx
page,
all the linkbuttons are bolded even though they are not clicked.

"Karl Seguin" wrote:
Trisha:
You are getting things confused.

You are setting the bold property of a control to true, then going to
another page. The control (linkbutton) doesn't survive through a
redirect...you create a new instance.....

If you want this boldedness value to survive postbacks and links you
should
use the :visited attribute of CSS.
http://www.blooberry.com/indexdot/cs...assvisited.htm
<asp:linkbutt on id="x" runat="server" CssClass="someC lass" ... />

and your css should look like:

someClass:visit ed{
font-weight:bold;
}
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
>I have a navigation user control navig.ascx that redirects to respective
> pages based on webcontrols.lin kbutton clicks using response.redire ct.
>
> I would like to control the look and feel of those link buttons. Once I
> click the button, I would like to make it bold using instructions like
>
> linkbutton.font .bold=true
>
> This works as long as its NOT followed by response.redire ct
>
> For example:
>
> linkbutton.font .bold=true;
> response.redire ct("mypage.aspx ");
>
> if I take out the response line, this works, with response line in the
> code,
> the instruction does get executed but some how link button does not get
> bolded.
> "mypage.asp x" does host navig.ascx user control as other navigated
> pages.
>
> Please help.
> Thanks
> Trisha


Nov 19 '05 #4
Karl,

Thanks for the answer. Please let me know if you know how to make the user
control aware what page its on. I will research it in the mean time.

Thanks

"Karl Seguin" wrote:
That's because those links have been visited in the past, which is how the
:visited pseudo-css-class works.

It dawns on me that you want the link to be bolded for the new page the user
is on to indicate to the user that this is the page you are on. In other
words, you want it bolded once and only once.

To do so, you should make the navigation control self-aware of what page it
is on and which linkbutton to bold. You shouldn't do it on the eventhandler
of the linkbutton click, but rather on the page_load of the user control.

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:7A******** *************** ***********@mic rosoft.com...
Karl,

When I apply this CssClass="someC lass" to all the linkbuttons on the ascx
page,
all the linkbuttons are bolded even though they are not clicked.

"Karl Seguin" wrote:
Trisha:
You are getting things confused.

You are setting the bold property of a control to true, then going to
another page. The control (linkbutton) doesn't survive through a
redirect...you create a new instance.....

If you want this boldedness value to survive postbacks and links you
should
use the :visited attribute of CSS.
http://www.blooberry.com/indexdot/cs...assvisited.htm
<asp:linkbutt on id="x" runat="server" CssClass="someC lass" ... />

and your css should look like:

someClass:visit ed{
font-weight:bold;
}
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
>I have a navigation user control navig.ascx that redirects to respective
> pages based on webcontrols.lin kbutton clicks using response.redire ct.
>
> I would like to control the look and feel of those link buttons. Once I
> click the button, I would like to make it bold using instructions like
>
> linkbutton.font .bold=true
>
> This works as long as its NOT followed by response.redire ct
>
> For example:
>
> linkbutton.font .bold=true;
> response.redire ct("mypage.aspx ");
>
> if I take out the response line, this works, with response line in the
> code,
> the instruction does get executed but some how link button does not get
> bolded.
> "mypage.asp x" does host navig.ascx user control as other navigated
> pages.
>
> Please help.
> Thanks
> Trisha


Nov 19 '05 #5
Karl,

I used the following line of code to get to the parent.

Parent.Page.ToS tring();

thanks again for all your help. I am good to go.

"Trisha" wrote:
Karl,

Thanks for the answer. Please let me know if you know how to make the user
control aware what page its on. I will research it in the mean time.

Thanks

"Karl Seguin" wrote:
That's because those links have been visited in the past, which is how the
:visited pseudo-css-class works.

It dawns on me that you want the link to be bolded for the new page the user
is on to indicate to the user that this is the page you are on. In other
words, you want it bolded once and only once.

To do so, you should make the navigation control self-aware of what page it
is on and which linkbutton to bold. You shouldn't do it on the eventhandler
of the linkbutton click, but rather on the page_load of the user control.

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Trisha" <tr****@nospam. nospam> wrote in message
news:7A******** *************** ***********@mic rosoft.com...
Karl,

When I apply this CssClass="someC lass" to all the linkbuttons on the ascx
page,
all the linkbuttons are bolded even though they are not clicked.

"Karl Seguin" wrote:

> Trisha:
> You are getting things confused.
>
> You are setting the bold property of a control to true, then going to
> another page. The control (linkbutton) doesn't survive through a
> redirect...you create a new instance.....
>
> If you want this boldedness value to survive postbacks and links you
> should
> use the :visited attribute of CSS.
> http://www.blooberry.com/indexdot/cs...assvisited.htm
>
>
> <asp:linkbutt on id="x" runat="server" CssClass="someC lass" ... />
>
> and your css should look like:
>
> someClass:visit ed{
> font-weight:bold;
> }
>
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is
> annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
> "Trisha" <tr****@nospam. nospam> wrote in message
> news:F8******** *************** ***********@mic rosoft.com...
> >I have a navigation user control navig.ascx that redirects to respective
> > pages based on webcontrols.lin kbutton clicks using response.redire ct.
> >
> > I would like to control the look and feel of those link buttons. Once I
> > click the button, I would like to make it bold using instructions like
> >
> > linkbutton.font .bold=true
> >
> > This works as long as its NOT followed by response.redire ct
> >
> > For example:
> >
> > linkbutton.font .bold=true;
> > response.redire ct("mypage.aspx ");
> >
> > if I take out the response line, this works, with response line in the
> > code,
> > the instruction does get executed but some how link button does not get
> > bolded.
> > "mypage.asp x" does host navig.ascx user control as other navigated
> > pages.
> >
> > Please help.
> > Thanks
> > Trisha
>
>
>


Nov 19 '05 #6

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

Similar topics

0
1924
by: Zi | last post by:
I have a user control within a data grid. I am binding the user control to one of the values from the data grid. The data grid implements paging. It is all working ok for the first page but once i page to the second page of the datagrid, the user contorl stops working correctly (displaying the correct data). I have attached the code that is envolved. Thanks a lot
2
3340
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating Usercontrols. Problem: When I am populating dynamic user control (ascx) page in Page_load event it works fine for the first list item from combobox. When I change the item in combobox, usercontrols are build properly but value will be same in second...
4
5378
by: Marty U. | last post by:
I have a Session variable I need to check the value of. If it is value a then redirect to some page. I need to implement this in a user control that is on all the relevent pages. I placed the if and redirect statement within the page_load of the user control. However, when you try to access any page that has the user control it simply loads for minutes and never actually redirects. What am I missing with executing the response.redirect...
1
2525
by: Andre Ranieri | last post by:
I have a quick question - I'd just like to have confirmation to be sure. I'm building an ASP.NET corporate site for my employer, some of the pages have e-commerce capability and will need to be SSL-encrypted. Thus, I assume I'll need to use absolute links to specifiy the https protocol (correct me if I'm wrong on that) Does ASP.NET handle an absolute link any different than a relative one? Will I have any problems maintaining session...
5
7660
by: Steve Richter | last post by:
In my user control I want to read the ViewState dictionary of the Parent control. But this sensible idea is not permitted by the compiler: Compiler Error Message: CS1540: Cannot access protected member 'System.Web.UI.Control.ViewState' via a qualifier of type 'System.Web.UI.Control'; the qualifier must be of type 'ASP.ItemOrderGrid' (or derived from it) Source Error:
2
2541
by: Nathan Sokalski | last post by:
I am using the Response.Redirect method in a User Control to allow visitors to click an ImageButton to take them to another page. However, when I click the ImageButton I recieve the following error: Response is not available in this context. I am assuming this is due to the fact that I am calling the method from the User Control rather than the Page. If I use context.Response.Redirect I am
4
3032
by: Max | last post by:
Hello, here a user control named aff.ascx : (this control is used to see the contains of a link) <%@ Control Language="VB" %> <script runat="server"> ' Insert user control code here Public adr As String </script>
5
2870
by: c676228 | last post by:
Hi, I guess I am confused. In aspx script, I mean (you won't use Codebehind="enrollinfo.aspx.vb", but mix code with html and code together) You can access user control's property directly. Since I am useing visual studio .net, the html and code are seperated. I have the following aspx code which has two user controls: <%@ Register TagPrefix="Subway" TagName="Peopleinfo" Src="Peopleinfo.ascx" %> <%@ Register TagPrefix="Subway"...
1
1819
by: weboweb | last post by:
Hello aspnet experts! I have a design question for the more experienced developers (more than me at least :-)). 1) I have a page in the application I'm building that displays a web user control with a list of folders (let's call it the TREE) 2) There is another control called document list which shows the list of documents for the selected tree folder (let's call it DOCLIST)
0
8221
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6104
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5560
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4067
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2593
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1468
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.