HighTechTalks DotNet Forums  

Newbie, how to display a messagebox always on top

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Newbie, how to display a messagebox always on top in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
verci
 
Posts: n/a

Default Newbie, how to display a messagebox always on top - 09-11-2006 , 01:14 PM






Hi, sorry if this seems stupid, please have patience.

I'm running Win XP sp2, VS 2005 Tem, SQL Sever 2005, I've been using a
gridview to display my DB information, on the Gridview_RowUpadating event
handler I validate if the value entered already exist en the DB using the
following.

Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridView1.RowUpdating

Dim valor As String = e.NewValues("ProductName").ToString

If RunQueryDr(valor) = True Then

e.Cancel = True

MsgBox("This value already exist!", MsgBoxStyle.ApplicationModal +
MsgBoxStyle.Critical, "Error")

Return

End If

End Sub

I want to display the message box always on top of other windows, so the
user can't minimize it or even worst keep trying to update the record and
thus opening various error message boxes, I've tried the JavaScript
openwindow and alert functions with no success.

Thanks



Reply With Quote
  #2  
Old   
Eliyahu Goldin
 
Posts: n/a

Default Re: Newbie, how to display a messagebox always on top - 09-12-2006 , 04:52 AM






A simple answer is that javascript alert function is the way to go. You can
pass the message to show to the client-side where it can be picked up and
displayed. The standard way of passing information between server and client
is using hidden input controls. Put this line in your web form:
<input type="hidden" runat="server" id="inhMessage"/>

The server code will set the message as

inhMessage.Value="This value already exist!"

The client code will access it as
<script>
function checkMessage(){
if(myForm.inhMessage.Value<>'')
{
alert(myForm.inhMessage.Value);
myForm.inhMessage.Value='';
}
}
</script>
....
<body onload='checkMessage()'/>

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


"verci" <iodataser (AT) yahoo (DOT) com> wrote

Quote:
Hi, sorry if this seems stupid, please have patience.

I'm running Win XP sp2, VS 2005 Tem, SQL Sever 2005, I've been using a
gridview to display my DB information, on the Gridview_RowUpadating event
handler I validate if the value entered already exist en the DB using the
following.

Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridView1.RowUpdating

Dim valor As String = e.NewValues("ProductName").ToString

If RunQueryDr(valor) = True Then

e.Cancel = True

MsgBox("This value already exist!", MsgBoxStyle.ApplicationModal +
MsgBoxStyle.Critical, "Error")

Return

End If

End Sub

I want to display the message box always on top of other windows, so the
user can't minimize it or even worst keep trying to update the record and
thus opening various error message boxes, I've tried the JavaScript
openwindow and alert functions with no success.

Thanks




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.