how do I call javascript in asp.net control

how do I call javascript in asp.net control

am 08.04.2008 00:36:00 von iHavAQuestion

Sir,

I have a ASP cotrol text box and a image button, on click of which I call a
javascript(pop up calender) and the below code works fine

What if i have to achive the same using ASP.NET control
.....

Can any one please help me out.




CODE
------
value=" mm/dd/yyyy" onfocus="if(this.value=='mm/dd/yyyy') this.value='';"
onblur="if(this.value=='') this.value='mm/dd/yyyy';" />


height="12">

Re: how do I call javascript in asp.net control

am 08.04.2008 00:48:59 von PopeDarren

Weeeeelll... in the page's load event you could add the attributes
like this:

myTxtBox.Attributes.Add("onfocus", "if(this.value=='mm/dd/
yyyy') this.value='';")
myTxtBox.Attributes.Add("onblur", "if(this.value=='')
this.value='mm/dd/yyyy';")

Re: how do I call javascript in asp.net control

am 08.04.2008 13:57:16 von George Ter-Saakov

What is the exact problem you having? Cause your question is to vague...

I suspect you ahving problem with control id? then do something like




George.


"iHavAQuestion" wrote in message
news:FABE3F08-358C-44F4-8176-C6A10A5A2742@microsoft.com...
> Sir,
>
> I have a ASP cotrol text box and a image button, on click of which I call
> a
> javascript(pop up calender) and the below code works fine
>
> What if i have to achive the same using ASP.NET control
> .....
>
> Can any one please help me out.
>
>
>
>
> CODE
> ------
> > value=" mm/dd/yyyy" onfocus="if(this.value=='mm/dd/yyyy') this.value='';"
> onblur="if(this.value=='') this.value='mm/dd/yyyy';" />
>
>
> > height="12">

Re: how do I call javascript in asp.net control

am 11.04.2008 17:17:04 von iHavAQuestion

Thanks George now it works..

Now I have one more issue.
I have downloaded Ajax frame work and in the toolbox I am getting AJAX
Extention in which i find the Script manager.
Bit,in the design form I am not getting this part of the tag..
I also added AjaxControlToolkit.dll in the bin directory.



"George Ter-Saakov" wrote:

> What is the exact problem you having? Cause your question is to vague...
>
> I suspect you ahving problem with control id? then do something like
>
>
>
>
> George.
>
>
> "iHavAQuestion" wrote in message
> news:FABE3F08-358C-44F4-8176-C6A10A5A2742@microsoft.com...
> > Sir,
> >
> > I have a ASP cotrol text box and a image button, on click of which I call
> > a
> > javascript(pop up calender) and the below code works fine
> >
> > What if i have to achive the same using ASP.NET control
> > .....
> >
> > Can any one please help me out.
> >
> >
> >
> >
> > CODE
> > ------
> > > > value=" mm/dd/yyyy" onfocus="if(this.value=='mm/dd/yyyy') this.value='';"
> > onblur="if(this.value=='') this.value='mm/dd/yyyy';" />
> >
> >
> > > > height="12">

>
>
>

Re: how do I call javascript in asp.net control

am 11.04.2008 17:53:20 von iHavAQuestion

Thank U Sir,
It works ::))

Now I have one more issue.
I have downloaded Ajax frame work and in the toolbox I am getting AJAX
Extention in which i find the Script manager.
Bit,in the design form I am not getting this part of the tag..
I also added AjaxControlToolkit.dll in the bin directory.


"PopeDarren@gmail.com" wrote:

> Weeeeelll... in the page's load event you could add the attributes
> like this:
>
> myTxtBox.Attributes.Add("onfocus", "if(this.value=='mm/dd/
> yyyy') this.value='';")
> myTxtBox.Attributes.Add("onblur", "if(this.value=='')
> this.value='mm/dd/yyyy';")
>