hi,
I think you have a little confusion between server side and client side,
c# code runs in the server, in the client it runs javascript ( most of the
time is like this anyway) , sometimes you need to interact and there are
several ways of doing it, you coudl trigger an action from the server side
by setting a variable that will be read in javascript like this:
in the aspx page :
<script>
var WhatToDo="";
function DoWhatYouHaveToDo()
{
if (WhatToDo!="")
DoSomething();
}
</script>
</HEAD>
<body onload="DoWhatYouHaveToDo();">
then in the code behind you can do this:
Controls.Add( new LiteralControl("<script>WhatToDo='DoIt';</script>) );
it will add that piece of code at the end of the page so you will have the
variable with a value assigned when you run the function.
Is this what you want?
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Parveen" <Pa*****@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I have a boolean variable defined in the aspx.cs code for my webpage. I
need
to read the value of this variable in the javascript code that i have in
the
codebehind file. Is there a way to do this??
I've tried the following but I get an error saying that "edit_clicked is
undefined."
if (edit_clicked == false)
<do what i have to do...>