In the examples the prompt style message box calls a javascript function using

Ext.Msg.Prompt("Name", "Please enter your name:", new JFunction { Fn = "showResultText" }).Show();
I want to call an AjaxMethod where I will do some database updates. How do I get the text from the prompt. I was planning to use this syntax:-

Ext.Msg.Prompt("Name", "Please enter the new username:", new MessageBox.ButtonsConfig
{
  Ok = new MessageBox.ButtonConfig { Handler = "Coolite.AjaxMethods.ChangeUsernameCallback('" + theText + '")", Text = "OK" },
  Cancel = new MessageBox.ButtonConfig { Text = "Cancel" }
}).Show();
Where 'theText' would hold the value of the text from the prompt input.