show warning message to user in ASP.NET
I have a pop up window that is create in run time, and can have several text area. I need to count number of characters of its text area and show warning to users if they pass maximum number. 
the application wrote by ASP.NET. I can't use "onClientClick", because I don't know the name of the text area, they created run time and I save their name in a dictionary that just have in server side. 
I tried to use "RegisterStartupScript" to call java script "alert" method but it doesn't work. In fact it works but it execute all the save code and show alert after that. but I want to execute save code after user confirmation.
I think to open message box with jquery but my current windows is opening with AJAX and it won't nice to open another AJAX page.
Can You help me and show me the way to show warning, or solving my problem.
show warning message to user in ASP.NET
===

I have a pop up window that is create in run time, and can have several text area. I need to count number of characters of its text area and show warning to users if they pass maximum number. 
the application wrote by ASP.NET. I can't use "onClientClick", because I don't know the name of the text area, they created run time and I save their name in a dictionary that just have in server side. 
I tried to use "RegisterStartupScript" to call java script "alert" method but it doesn't work. In fact it works but it execute all the save code and show alert after that. but I want to execute save code after user confirmation.
I think to open message box with jquery but my current windows is opening with AJAX and it won't nice to open another AJAX page.
Can You help me and show me the way to show warning, or solving my problem.