Delphi ile web sayfasında showmesaj verme

Delphi .net ve .net ile ilgili konuları buraya yazabilirsiniz.
Cevapla
Kullanıcı avatarı
NewMember
Üye
Mesajlar: 990
Kayıt: 29 Haz 2005 06:57
Konum: Bursa

Delphi ile web sayfasında showmesaj verme

Mesaj gönderen NewMember »

Arkadaşlar delphi ile aspnet için web sayfası hazırlarken nasıl mesaj verdirebiliriz.
Aşağıdaki kodda hata veriyor.Bir bilen varsa yadımcı olabilirse sevinirim.
MessageBox.Show('Merhaba Dünya','Başlık',MessageBoxButtons.OK,MessageBoxIcon.Information);

Hata Mesajı
It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.]
System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon)
register.Tregister.Button1_Click(Object sender, EventArgs e) in D:\BORLAND\SAЀLIKSEN\ASPNET\register.pas:103
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Kullanıcı avatarı
lazio
Moderator
Mesajlar: 1527
Kayıt: 11 Tem 2003 04:55
Konum: İstanbul

Mesaj gönderen lazio »

bu şekilde yapmak mümkün değil ama javascript ile yapabilirsin..

Kod: Tümünü seç

<script>
<asp:Literal id="MyAlert" runat="server" EnableViewState="False"></asp:Literal>
</script>

Kod: Tümünü seç

  protected System.Web.UI.WebControls.Literal MyAlert;
  ....
  ....
  ltlAlert.Text := 'alert(''' + 'mesaj' + ''')';
yada
Response.Write('<script>....</script>) şeklinde yazabilirsin..
DeveloperToolKit

..::|YeşilMavi|::..
Kullanıcı avatarı
NewMember
Üye
Mesajlar: 990
Kayıt: 29 Haz 2005 06:57
Konum: Bursa

Mesaj gönderen NewMember »

@lazio.Çok teşekkürler.
Cevapla