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. using backend variables in html code

using backend variables in html code

Scheduled Pinned Locked Moved ASP.NET
html
2 Posts 2 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.
  • L Offline
    L Offline
    laziale
    wrote on last edited by
    #1

    hello everyone - I want to know how I can use my variable from the backend code in the designer code for a page. I have a url, and I want to attach a variable to it, something like this:

    A 1 Reply Last reply
    0
    • L laziale

      hello everyone - I want to know how I can use my variable from the backend code in the designer code for a page. I have a url, and I want to attach a variable to it, something like this:

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      You mean you want to add a variable or a script. ?? If you want a variable.. you need to write using <% %> tag. Just like : <%= this.MyText %> (provided MyText is a class level variable with atleast protected access specifier is applied). On the other hand if this is a script, in Page_Load use

      string scriptelement = "if (document.all||window...."; //your script
      if(!this.ClientScript.IsClientScriptBlockRegistered("myscript"))
      this.ClientScript.RegisterStartupScript(this.GetType(), "myscript", scriptelement, true);

      :-D :rose:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      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