Page.ClientScript.RegisterClientScriptBlock Not Working in my page
-
Hi In my page i write like this: Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",true); But no popup window open ..is this right code?
-
Hi In my page i write like this: Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",true); But no popup window open ..is this right code?
Try following code.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",false);
You were supplied last argument as true, which denotes that it will add script tag automatically. While you already provided script tag. HTH
Jinal Desai - LIVE Experience is mother of sage....
-
Hi In my page i write like this: Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",true); But no popup window open ..is this right code?
Do You have
AJAX Script Manager
in your web page. If you then you need to useScriptManager.RegisterClientScriptBlock
.Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net | Follow Me @ twitter Read my Latest Article :Mastering Debugging in VS 2010
-
Do You have
AJAX Script Manager
in your web page. If you then you need to useScriptManager.RegisterClientScriptBlock
.Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net | Follow Me @ twitter Read my Latest Article :Mastering Debugging in VS 2010
ScriptManager is not necessary to inject script blocks into the page, even if you are using Ajax.
I know the language. I've read a book. - _Madmatt
-
ScriptManager is not necessary to inject script blocks into the page, even if you are using Ajax.
I know the language. I've read a book. - _Madmatt
Mark Nischalke wrote:
ScriptManager is not necessary to inject script blocks into the page, even if you are using Ajax.
Agree Mark. I just asked him to check if he has used scriptmanager then he need to use scriptmanager.register.. Yes, this is not necessary. But It can be used.
Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net | Follow Me @ twitter Read my Latest Article :Mastering Debugging in VS 2010
-
Try following code.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",false);
You were supplied last argument as true, which denotes that it will add script tag automatically. While you already provided script tag. HTH
Jinal Desai - LIVE Experience is mother of sage....
I tried making last argument false as well but it still not giving the popup block
-
I tried making last argument false as well but it still not giving the popup block
Are you trying to get that script executed when the page is sent back to the browser?? This question should really be asked in the ASP.NET forum.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...