|
-
Feb 20th, 2003, 05:07 AM
#1
Thread Starter
Addicted Member
accessing C# variable in ASPX HTML code ..
can some one tell me how i can access C # code variable in ASPX 's HTML Design .. like suppose i have some value in C # code and i want to show or access it in Java Script or VB Script .. how i can do that ?? based on some Server side variable data i want to do some thing at client end .. wats the way for tht ??
ne one can put some light on it ??
-
Feb 20th, 2003, 10:13 AM
#2
Junior Member
Here's how I've done it in VB.net:
In the code-behind, declare a public variable at the top of the page (where you declare your controls), like:
Public strVariable As String
Then on the aspx page you need to put a tag like this:
<%# strVariable %>
In my experience, this only seems to work if you call the Page.Databind method in the Page_Load sub.
Let me know if it works for you.
-
Feb 26th, 2003, 03:28 PM
#3
yay gay
u can hard code a script in java which when the page is created creates a var in that java script and puts there the variable
\m/  \m/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|