Solved

ValidationSummary alignment

Posted on 2004-09-22
10
1,013 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

22 Experts available now in Live!

Get 1:1 Help Now