Solved

ValidationSummary alignment

Posted on 2004-09-22
10
1,023 Views
Last Modified: 2008-02-01
hi all
i am tring to align the ValidationSummary to center of page but i could't find any such propery?
0
Comment
Question by:sash_he
  • 5
  • 5
10 Comments
 
LVL 9

Expert Comment

by:hismightiness
ID: 12127460
Just put your mouse cursor next to the Validation Summary, and align the line (<p> tag) using the toolbar alignment button.  An alternative is to create a CSS Class for the ValidationSummary.  I have done both (depends on the project).
0
 
LVL 9

Expert Comment

by:hismightiness
ID: 12127474
Also, you can implement a <DIV> in the HTML view.  You can set the alignment using any of these methods.
0
 

Author Comment

by:sash_he
ID: 12127487
i did that it still doest show up in browser
ia m using mozilla browser
0
 

Author Comment

by:sash_he
ID: 12127493
how to make  CSS Class ?
0
 
LVL 9

Expert Comment

by:hismightiness
ID: 12127524
In header of page...

<head>
<style>
.dgStyle
{
text-align: center;
}
</style>
</head>


Now just set the CSSClass property of the datagrid to "dgStyle".
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:sash_he
ID: 12128223
Nope i am still not getting it in mozilla
however it works fine in IE
0
 

Author Comment

by:sash_he
ID: 12128494
i have another question is to possible to display some part of errortext message in italic text some in normal text
0
 
LVL 9

Expert Comment

by:hismightiness
ID: 12128913
I just tried it in Mozilla and it worked.  Here is my example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <title>WebForm1</title>
            <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
            <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
            <meta name="vs_defaultClientScript" content="JavaScript">
            <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
            <style type="text/css">
            .dgStyle { TEXT-ALIGN: center }
            </style>
      </HEAD>
      <body MS_POSITIONING="GridLayout">
            <form id="Form1" method="post" runat="server">
                  <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 18px" runat="server"></asp:TextBox>
                  <asp:TextBox id="TextBox2" style="Z-INDEX: 102; LEFT: 17px; POSITION: absolute; TOP: 49px" runat="server"></asp:TextBox>
                  <asp:TextBox id="TextBox3" style="Z-INDEX: 103; LEFT: 16px; POSITION: absolute; TOP: 81px" runat="server"></asp:TextBox>
                  <asp:RequiredFieldValidator id="RequiredFieldValidator1" style="Z-INDEX: 104; LEFT: 184px; POSITION: absolute; TOP: 24px" runat="server" ErrorMessage="Fill in textbox 1" ControlToValidate="TextBox1" ToolTip="Fill in textbox 1">!</asp:RequiredFieldValidator>
                  <asp:RequiredFieldValidator id="RequiredFieldValidator2" style="Z-INDEX: 105; LEFT: 186px; POSITION: absolute; TOP: 54px" runat="server" ErrorMessage="Fill in textbox 2" ControlToValidate="TextBox2" ToolTip="Fill in textbox 2">!</asp:RequiredFieldValidator>
                  <asp:RequiredFieldValidator id="RequiredFieldValidator3" style="Z-INDEX: 106; LEFT: 187px; POSITION: absolute; TOP: 87px" runat="server" ErrorMessage="Fill in textbox 3" ControlToValidate="TextBox3" ToolTip="Fill in textbox 3">!</asp:RequiredFieldValidator>
                  <asp:ValidationSummary id="ValidationSummary1" style="Z-INDEX: 107; LEFT: 298px; POSITION: absolute; TOP: 13px" runat="server" HeaderText="The following errors have occurred:" CssClass="dgStyle"></asp:ValidationSummary>
                  <asp:Button id="Button1" style="Z-INDEX: 108; LEFT: 219px; POSITION: absolute; TOP: 73px" runat="server" Text="Button"></asp:Button>
            </form>
      </body>
</HTML>
0
 
LVL 9

Accepted Solution

by:
hismightiness earned 50 total points
ID: 12128928
You can do the italic/normal thing simply by putting HTML in your error messages.  For instance, in the ErrorMessage property of your validator put:

This is a <i>required</i> field!

I have also tried this in Mozilla successfully.  I am a regular user and preacher of Mozilla.  I only use other browsers at work.
0
 

Author Comment

by:sash_he
ID: 12129133
Thanks @hismightiness  for both answers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now