Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access a c# variable's value in an .aspx page?

Tags:

asp.net

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

we need to access the c# variable in .aspx page at the time we have problem

Please guide us?

like image 742
subramani Avatar asked Sep 30 '09 16:09

subramani


People also ask

How do I access AC DLC?

After downloading the DLC, you'll need to head to Ravensthorpe, then speak to Azar at the docks. From there you'll start a questline that allows you to enter Ireland via the Irish Tradepost: a new structure built for the DLC. As an aside, you do not need to be a specific power level to access the DLC.

How do I access Dawn of Ragnarok?

To start playing Dawn of Ragnarök without an existing saved game: Go to the main menu. Select New Game. Under Choose your experience, select Dawn of Ragnarök.

How do I start Wrath of the Druids?

You can start the Wrath of the Druids questline by speaking to Azar at the docks in Ravensthorpe. For Azar to appear you will need to have reached England and completed at least one regional arc.

How do you get to Valhalla AC?

You'll need to have reached a point in the main story where you are able to upgrade your AC Valhalla settlement (opens in new tab) at Ravensthorpe to level 3. Once you've reached this level, Valka will arrive from Norway and you'll be able to set to work building a Seer's Hut for her.


1 Answers

It would help if you gave more detail about what you're trying to do, however you can try this:

First make any variables you want to access in your aspx markup protected.

Then in the page_load method, call DataBind();

Then in your markup you can do this:

<%# VariableName %>

The "<%=" sequence can only be used within certain contexts in server controls. The sequence "<%#" is for DataBound controls and can be used in any context in ASPX page markup. Calling DataBind(); allows you to use this (almost) anywhere on the page.

like image 193
Dan Herbert Avatar answered Sep 30 '22 06:09

Dan Herbert