[Mono-list] Messagebox-Problem

Jan Waiz hamburg at icomedv.de
Tue Nov 1 06:18:57 EST 2005


Hi All,

 

may be someone will kill me for posting this again – but i am completely
Confused about how to realize a Message- and a Questionbox that works with
Mono !!

 

Nobody out there, who is using Message- and Questionboxes ? 

 

How did you handle for Example the Fact, if a User will delete a Record? No
Feedback like “Do you realy want do delete this one?” ??

 

Here is the Code, that works with Windows/IIS and not (!) with Mono:

 

// =====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?" );

  }

}

 

That’s 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 ?

 

Many Thanks for any Replay !!

 

Regards

Jan Waiz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20051101/8161181a/attachment.html


More information about the Mono-list mailing list