Jan 15, 2010, 2:31 PM
[CLOSED] [1.0] Ext.Msg.Show Code behind
I have a Window that pops up with a Accept and Decline button. When the Decline button is clicked, it does some processing and database updating on the backend.
If the database fails to update, I want to show a MessageBox with the error. However, no matter what I have tired, I've had no luck showing the MessageBox.
.aspx:
If the database fails to update, I want to show a MessageBox with the error. However, no matter what I have tired, I've had no luck showing the MessageBox.
.aspx:
<ext:Window ID="wDecline" runat="server" Title="Decline?" Icon="Delete" Modal="true" Resizable="false" Layout="Fit" Width="300" Height="250">
<Items>
<ext:Label runat="server" Text="Stuff here" />
</Items>
<Buttons>
<ext:Button ID="bDecline" runat="server" Text="Decline" Icon="Delete">
<DirectEvents>
<Click OnEvent="bDecline_Click" />
</DirectEvents>
</ext:Button>
<ext:Button ID="bAbort" runat="server" Text="Abort" Icon="Reload">
<Listeners>
<Click Handler="wDecline.hide();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Window>
.aspx.cs:protected void bDecline_Click(object sender, DirectEventArgs e)
{
Exception error = null;
try
{
// Do database stuff here
}
catch(Exception ex)
{
error = ex;
}
if (error != null)
{
// TODO: Want to show Ext.Messagebox from here with the error.
// I have tried AddScript, etc. with no luck
}
else
{
Response.Redirect("default.aspx");
}
}
Thanks.