[Mono-list] onclick-Event the Second
Jan Waiz
hamburg at icomedv.de
Sat Oct 29 06:20:52 EDT 2005
Hi All,
few Days ago i posted a Problem and i did not get any Help or Tip. So I try
to make the Call again and hope, that someone will be so kind and help me.
Here is the Problem:
To realize a Message-Boxes, I made a Class Messages like this:
// =====bof
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace DevProjects_IComVBX.VBXClasses
{
/// <summary>
/// Zusammenfassung für VBXMessages.
/// </summary>
public class VBXMessages
{
public VBXMessages()
{
}
public void CreateConfirmBox( Button oButton, string
cMessage )
{
oButton.Attributes.Add( "onclick", "return
confirm('" + cMessage + "');" );
}
public void CreateAlertBox( Page oPage, string
cMessage, string cMsgKey )
{
string cScript = "<script language=Javascript>" +
"alert('" + cMessage + "')" +
"</script>";
if ( !oPage.IsStartupScriptRegistered(cMsgKey) )
{
oPage.RegisterStartupScript( cMsgKey, cScript );
}
}
}
}
// =====eof
>From Code I use it for an Alertbox like this:
Private void doSomething
{
If ( !true )
{
VBXMessages oMsg = new VBXMessages();
oMsg.CreateAlertBox( this, "Something Failed!", marker1 );
}
}
THIS will work fine from Dev-Environment (Windows/VS2003) AND (!) when
running from Mono.
Now an Example, how implement a Confirmbox:
private void Page_Load(object sender, System.EventArgs e)
{
if( !IsPostBack )
{
VBXMessages oMsg = new VBXMessages();
oMsg.CreateConfirmBox( btnDele, "Delete that Record?" );
}
}
Thats working fine also when running from my Dev-Environment (as described
above) but when running from Mono:
NOTHING HAPPENS ! :-)
The generated HTML looks like this:
<td valign="bottom" align="right" width="100">
<input type="submit" name="btnDele" value="Lschen" onclick="if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate();"
language="javascript" id="btnDele" onclick="return confirm('Delete that
Record?');"
style="border-width:1px;border-style:Solid;height:20px;width:100px;" />
</td>
WHATS WRONG ?
Or: Does anyone knows what I can do to implement this 2 Features: an
Alertbox and a Confirmbox that will work with Mono and IIS ?
Regards
Jan Waiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20051029/2c3c85d3/attachment-0001.html
More information about the Mono-list
mailing list