javascript in asp.net

Posted by Bhavna81 under Regular Expressions on 10/21/2009 | Views : 2732 | Status : [Member] | Replies : 4
Hi,

my code for disable the input tag is:
string script = "<script>function EnableFunc(){document.form2.txtPCC.disble=false;" +
"document.form2.txtCNST.disble=false;" +
"document.form2.txtSTAX.disble=false; alert('hello');} EnableFunc(); </script>";
if (!ClientScript.IsStartupScriptRegistered(this.GetType(), "mast"))
{
ClientScript.RegisterStartupScript(this.GetType(),
"mast", script);
}

but its not working. is anybody help me.... where i m wrong?????

and also i want to enable it on some button click......

please help..
thanks.




Responses

Posted by: Virendradugar on: 10/21/2009 [Member] [MVP] Silver

Up
0
Down
Hi,

I have few queries. It willl be helpful if you can answer them to solve this problem.

1. Are you getting any JavaScript Error?
2. Are you using Ajax?

I will suggest that you create your Javascript function in the head function and just registrer the Calling of JavaScript function from your code behind.


string script = "<script> EnableFunc(); </script>"; 

if (!ClientScript.IsStartupScriptRegistered(this.GetType(), "mast"))
{
ClientScript.RegisterStartupScript(this.GetType(),"mast", script);
}


Thanks,
Virendra Dugar

Bhavna81, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tridev_2005 on: 10/21/2009 [Member] Starter

Up
0
Down
you can tell me what error come ???

Thanks,


Bhavna81, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhavna81 on: 10/22/2009 [Member] Starter

Up
0
Down
hi,
no error is display... nothing is done.
thanks.


Bhavna81, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tridev_2005 on: 10/22/2009 [Member] Starter

Up
0
Down
Try this steps

1. Open Internet Explorer.
2. Select Internet Options from the Tools menu.
3. In Internet Options dialog box select the Security tab.
4. Click Custom level button at bottom. The Security settings dialog box will pop up.
5. Under Scripting category enable Active Scripting, Allow paste options via script and Scripting of Java applets
6. Click OK twice to close out.
7. Hit Refresh

or download Java Virtual Machine from internet.

http://www.badminton.nl/files/bestanden/msjavx86.exe


after install and ask restart your system.

Bhavna81, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response