Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. dynamic styles

dynamic styles

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netwpfhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kkadir
    wrote on last edited by
    #1

    Hello everyone, I am trying to change styles of some client-side objects dynamically. For example whenever the user is at the mainPage.aspx, the text between <div id="activeMainPage">blablabla</div> should be bold. My problem is : how can I get the current page, and how can I change the text's style dynamically ? BTW, I am a really newbie in ASP.Net. Thanks for your helps and best regards.

    .:: Something is Wrong ::.

    M K R 3 Replies Last reply
    0
    • K kkadir

      Hello everyone, I am trying to change styles of some client-side objects dynamically. For example whenever the user is at the mainPage.aspx, the text between <div id="activeMainPage">blablabla</div> should be bold. My problem is : how can I get the current page, and how can I change the text's style dynamically ? BTW, I am a really newbie in ASP.Net. Thanks for your helps and best regards.

      .:: Something is Wrong ::.

      M Offline
      M Offline
      mghiassi
      wrote on last edited by
      #2

      Hello, You can use CSSclass.

      1 Reply Last reply
      0
      • K kkadir

        Hello everyone, I am trying to change styles of some client-side objects dynamically. For example whenever the user is at the mainPage.aspx, the text between <div id="activeMainPage">blablabla</div> should be bold. My problem is : how can I get the current page, and how can I change the text's style dynamically ? BTW, I am a really newbie in ASP.Net. Thanks for your helps and best regards.

        .:: Something is Wrong ::.

        K Offline
        K Offline
        kinsella_john
        wrote on last edited by
        #3

        unfortunately i am also a bit of a newbie in asp.net and cant offer a dynamic response, however there is a simple way that you can get your text bold on certain pages that should work through asp.net. presumably you are using external css style sheets.. in which case create a style for you div ie #activeMainPage { font-size:60pt; } in your external page and then if you only wish it to appear on mainpage.aspx / then only refer to it from that page. so for each normal page you could for example name your div "homelink" and for your main page call it "activehomelink". i know this doesnt directly answer your question, but i hope that it offers you a solution, all be it a non-dynamic one. if you already knew this way, good luck in your search for the dynamic way cheers

        John Michael Kinsella kinsellajohn@hotmail.com

        K 1 Reply Last reply
        0
        • K kinsella_john

          unfortunately i am also a bit of a newbie in asp.net and cant offer a dynamic response, however there is a simple way that you can get your text bold on certain pages that should work through asp.net. presumably you are using external css style sheets.. in which case create a style for you div ie #activeMainPage { font-size:60pt; } in your external page and then if you only wish it to appear on mainpage.aspx / then only refer to it from that page. so for each normal page you could for example name your div "homelink" and for your main page call it "activehomelink". i know this doesnt directly answer your question, but i hope that it offers you a solution, all be it a non-dynamic one. if you already knew this way, good luck in your search for the dynamic way cheers

          John Michael Kinsella kinsellajohn@hotmail.com

          K Offline
          K Offline
          kkadir
          wrote on last edited by
          #4

          Thanks for your helps Kinsella, That is the exact thing what I was doing. The problem is how to make my objects use the activeXX{...} style when they should. I think some javascript will help. Anyway, search never ends :D.

          .:: Something is Wrong ::.

          1 Reply Last reply
          0
          • K kkadir

            Hello everyone, I am trying to change styles of some client-side objects dynamically. For example whenever the user is at the mainPage.aspx, the text between <div id="activeMainPage">blablabla</div> should be bold. My problem is : how can I get the current page, and how can I change the text's style dynamically ? BTW, I am a really newbie in ASP.Net. Thanks for your helps and best regards.

            .:: Something is Wrong ::.

            R Offline
            R Offline
            RichardGrimmer
            wrote on last edited by
            #5

            Basic js manipulation of DOM objects centres around the document.getElementById function - give it the id you want and a variable is returned representing the object. From there, you can manipulate the .style.XXX attributes of the object to style them as you need. Best resource for this? www.w3schools.com

            "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups