views:

418

answers:

2

I am trying to implement a web page that will on an asp.net submit button click will go to the server to add a row to the SQL database table. After that, on that same page, I want to be able to display the columnID as an alert using javascript (this has to be javascript). Is this possible? Any help would be appreciated.

+1  A: 

Here's another SO question that will tell you the answer.

Dave L
A: 

Another trick picked up from Telerik was to create a asp:Label and place it at the top of the page. From code behind you then set the text to javascript command:

aspLabel.Text = "JavascriptFunction();";

When your page reloads, it will execute the Javascript function. It seems that in your case your just interested in displaying and alert, so registering scripts should not be necessary. In your case you can do the following:

aspLabel.Text = "alert('" + yourValue.ToString() + "');";
David Robbins