How can I use this same javascript in the asp.net 2.0, where I have a master
page.
<html >
<script language="javascript" type="text/javascript">
function functionName(cnt_id)
{}
function functionName2
{}
</script>
<form id="form1" runat="server">
<body>
Date: <input runat="server" id="TextBox1" type="text"
onfocus="javascript:functionName('TextBox1')"/>
</body>
</form>
</html>
George Ter-Saakov - 24 Mar 2008 16:00 GMT
My guess you have a problem with changed id of the control....
There are several solutions but in your case you can use "this"
<script language="javascript" type="text/javascript">
function functionName(cnt)
{
alert(cnt.id);
}
</script>
Date: <input runat="server" id="TextBox1" type="text"
onfocus="javascript:functionName(this);"/>
PS: also you can always use <%=TextBox1.ClinetID%>
PPS: Next try to point to a problem so we do not have to guess... :)
George.
> How can I use this same javascript in the asp.net 2.0, where I have a
> master
[quoted text clipped - 17 lines]
> </form>
> </html>
iHavAQuestion - 24 Mar 2008 16:21 GMT
I tried the same George before i posted the thread, but I ned to know, how do
I call the same javascript from the master page.
> My guess you have a problem with changed id of the control....
>
[quoted text clipped - 36 lines]
> > </form>
> > </html>
bruce barker - 24 Mar 2008 16:36 GMT
the master page is just a control on your page. you call javascript from it
just like any other control (there is no difference).
-- bruce (sqlwork.com)
> How can I use this same javascript in the asp.net 2.0, where I have a master
> page.
[quoted text clipped - 16 lines]
> </form>
> </html>