Put that condition statement in a function, then call that onload instead.
How can i call me java script function on formload.
I am using this code
object value = Request.QueryString["val"].ToString();
if (value == "1")
{
Form.Attributes.Add("onLoad()","msg()" );
}
javascript;
function msg()
{
alert(U r in my frame);
}
I hav also trying
In my web page:
TextBox.Text=Request.QueryString["val"].ToString();
In my javascript page:
function msg()
{
if(TextBox1.Text=="1")
{
alert("u r in my frame");
}
}
In My HTML:
<body style="text-align: center" onload="msg()">
But this html code called at the initial loading of form.so that after this calling web page passing value on textbox so this function is also useless.. :(