MessageBox

shlvy

Regular
Joined
Oct 27, 2003
Messages
68
Hi
I made a registration form and i want that the error message will appear only with a message box without any other message.
I use :
<asp:ValidationSummary runat="server"
DisplayMode="BulletList" />
To show the summary, but there are messages too in the page.
Example for Validate :
<asp:RequiredFieldValidator runat="server"
ControlToValidate="tbRetypePassword"
ErrorMessage="blabla"
Display="none"
TextMode="password" />

<asp:CompareValidator runat="server"
ControlToValidate="tbPassword"
ControlToCompare="tbRetypePassword"
Operator="Equal"
ErrorMessage="blabla"
Display="none" />

Thank's
 
Hi
Thanks but its not working.
All i want to do is to delete the message in the page and leave the message box.
Thank's
 
You can Use the Validation Summry Control to display the Error Messages From The Validation Controls to display in a message box.

Set The Validation Summery Control's ShowMessageBox Property To True and its ShowSummry property to false.

also you need to set the Display property of all the validation controls to none

It will Dome The work.
 
Properites for validationsummary to control clientside script

iebidan said:
Follow this link http://www.codeproject.com/aspnet/asppopup.asp

will take you to a really cool control for a non intrusive message... designed for ASP .NET

Hi -
I read your reply about the validationsummary control and I was hoping you could help me also.
my aspx code as follows:
<form id="Form1" method="post" runat="server">
<asp:TextBox id="txtCheck" style="Z-INDEX: 101; LEFT: 136px; POSITION: absolute; TOP: 88px" runat="server" Width="192px"></asp:TextBox>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" style="Z-INDEX: 102; LEFT: 136px; POSITION: absolute; TOP: 64px" runat="server" Width="193px" ErrorMessage="Where's the message box?" Height="16px" ControlToValidate="txtCheck" Display="None"></asp:RequiredFieldValidator>
<asp:ValidationSummary id="ValidationSummary1" style="Z-INDEX: 103; LEFT: 136px; POSITION: absolute; TOP: 120px" runat="server" Width="256px" Height="24px" ShowSummary="False" ShowMessageBox="True"></asp:ValidationSummary>
<INPUT style="Z-INDEX: 104; LEFT: 136px; WIDTH: 200px; POSITION: absolute; TOP: 208px; HEIGHT: 32px" type="submit" value="Submit">
</form>
this simple form still doesn't show message box when requiredfieldvalidator1 fails validation, but they work with showmessagebox property is set to false and display is set to dynamic or static. you have any ideas?

Thanks for the help in advance.
 
shlvy said:
Hi
I made a registration form and i want that the error message will appear only with a message box without any other message.
I use :
<asp:ValidationSummary runat="server"
DisplayMode="BulletList" />
To show the summary, but there are messages too in the page.
Example for Validate :
<asp:RequiredFieldValidator runat="server"
ControlToValidate="tbRetypePassword"
ErrorMessage="blabla"
Display="none"
TextMode="password" />

<asp:CompareValidator runat="server"
ControlToValidate="tbPassword"
ControlToCompare="tbRetypePassword"
Operator="Equal"
ErrorMessage="blabla"
Display="none" />

Thank's
As an example I've done the following on my pages:

// (updating a database)
int i = cmd.ExecuteNonQuery();
if(i<1)
{
ClearForm(); clears the user input
DisplayMessage("Unable to update database!");
}
private void DisplayMessage(string message)
{
Response.Write("<script language=\"JavaScript\">alert(\"" + message + "\");</script>)";
}

Works great for my needs.
 
Back
Top