abu_dayya Posted May 11, 2006 Share Posted May 11, 2006 Hello everyone ..I know this might be an old topic, but i just can't seem to get it working.how can i use a javascript function to run with my asp.net2.0/c# project. All i want to do is display a confirm pop-up to check some insertion or deletion in the DB. I know i have to use ClientScript.RegisterClientScriptBlock, the problem is i don't know how to use that method properly, and i got lost in the MSDN.Lets say i have some textboxes to be filled, then when the user clickes on the asp:Button i want the Button1_clicked method to do some validation checking, then display the confirm pop-up to ask " are you sure you want to insert to DB". If anyone can show me some code i would realy appreciate it.Thanks in advanceAbu_Dayya Link to comment Share on other sites More sharing options...
aspnetguy Posted May 11, 2006 Share Posted May 11, 2006 you can do this. string js = "<script>...</script>";this.RegisterStartupScript("key",js); Note: this is for .Net 1.1 so it might not work but I think is should. Link to comment Share on other sites More sharing options...
abu_dayya Posted May 13, 2006 Author Share Posted May 13, 2006 i put it in a Page_Load method, all i get is the text of the script on the page when i run it.Does this mean that its not working? or how can i call it ?thanks for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now