By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,979 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,979 IT Pros & Developers. It's quick & easy.

required field validator

P: n/a
I'm having trouble getting the required field validator to work. I can
still save the row in the datagrid... I can't see what I'm doing
wrong.

<asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="lblPassword"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="txtPassword" Width="50">
</asp:TextBox>
<asp:RequiredFieldValidator id="rfvPassword" runat="server"
ErrorMessage="*" ControlToValidate="txtPassword"
Display="Dynamic"></asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateColumn>

Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Two possible problems.

1. Client-side validation is not correctly setup.
On the server, run this command (via cmd.exe):
aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]

2. Server side validation has not been correctly coded.
You must always check Page.IsValid is true in your post back event handler
method before saving.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:8f********************************@4ax.com...
I'm having trouble getting the required field validator to work. I can
still save the row in the datagrid... I can't see what I'm doing
wrong.

<asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="lblPassword"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="txtPassword" Width="50">
</asp:TextBox>
<asp:RequiredFieldValidator id="rfvPassword" runat="server"
ErrorMessage="*" ControlToValidate="txtPassword"
Display="Dynamic"></asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateColumn>

Nov 18 '05 #2

P: n/a
It's strange as the client side validation works fine on another site
on the same server. The working site runs as in a virtual folder under
the server's ip. The site not working is set up as an independent
site! Could this be the problem?

The folder "aspnet_client" only resides in my wwwroot folder. Could I
simply xcopy the aspnet_client folder to the new site's root?

Will running "aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]" cause changes to
existing sites?

Morten

On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <PL****@Blum.info>
wrote:
Two possible problems.

1. Client-side validation is not correctly setup.
On the server, run this command (via cmd.exe):
aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]

2. Server side validation has not been correctly coded.
You must always check Page.IsValid is true in your post back event handler
method before saving.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:8f********************************@4ax.com.. .
I'm having trouble getting the required field validator to work. I can
still save the row in the datagrid... I can't see what I'm doing
wrong.

<asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="lblPassword"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="txtPassword" Width="50">
</asp:TextBox>
<asp:RequiredFieldValidator id="rfvPassword" runat="server"
ErrorMessage="*" ControlToValidate="txtPassword"
Display="Dynamic"></asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateColumn>


Nov 18 '05 #3

P: n/a
Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

"hansiman" wrote:
It's strange as the client side validation works fine on another site
on the same server. The working site runs as in a virtual folder under
the server's ip. The site not working is set up as an independent
site! Could this be the problem?

The folder "aspnet_client" only resides in my wwwroot folder. Could I
simply xcopy the aspnet_client folder to the new site's root?

Will running "aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]" cause changes to
existing sites?

Morten

On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <PL****@Blum.info>
wrote:
Two possible problems.

1. Client-side validation is not correctly setup.
On the server, run this command (via cmd.exe):
aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]

2. Server side validation has not been correctly coded.
You must always check Page.IsValid is true in your post back event handler
method before saving.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:8f********************************@4ax.com.. .
I'm having trouble getting the required field validator to work. I can
still save the row in the datagrid... I can't see what I'm doing
wrong.

<asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="lblPassword"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Password") %>' ID="txtPassword" Width="50">
</asp:TextBox>
<asp:RequiredFieldValidator id="rfvPassword" runat="server"
ErrorMessage="*" ControlToValidate="txtPassword"
Display="Dynamic"></asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateColumn>


Nov 18 '05 #4

P: n/a
running aspnet_regiis.exe -c from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
made the client side validation work.

Must I run the tool upon every new site that is created on the server?

On Tue, 30 Nov 2004 15:17:05 -0800, "Patrick.O.Ige"
<Pa*********@discussions.microsoft.com> wrote:
Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

"hansiman" wrote:
It's strange as the client side validation works fine on another site
on the same server. The working site runs as in a virtual folder under
the server's ip. The site not working is set up as an independent
site! Could this be the problem?

The folder "aspnet_client" only resides in my wwwroot folder. Could I
simply xcopy the aspnet_client folder to the new site's root?

Will running "aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]" cause changes to
existing sites?

Morten

On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <PL****@Blum.info>
wrote:
>Two possible problems.
>
>1. Client-side validation is not correctly setup.
>On the server, run this command (via cmd.exe):
>aspnet_regiis.exe -c
>from [windows]\microsoft.net\framework\[version]
>
>2. Server side validation has not been correctly coded.
>You must always check Page.IsValid is true in your post back event handler
>method before saving.
>
>--- Peter Blum
>www.PeterBlum.com
>Email: PL****@PeterBlum.com
>Creator of "Professional Validation And More" at
>http://www.peterblum.com/vam/home.aspx
>
>"hansiman" <ha***@hotmail.com> wrote in message
>news:8f********************************@4ax.com.. .
>> I'm having trouble getting the required field validator to work. I can
>> still save the row in the datagrid... I can't see what I'm doing
>> wrong.
>>
>> <asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
>> <ItemTemplate>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
>> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
>> </ItemTemplate>
>> <EditItemTemplate>
>> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
>> "DataItem.Password") %>' ID="txtPassword" Width="50">
>> </asp:TextBox>
>> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
>> ErrorMessage="*" ControlToValidate="txtPassword"
>> Display="Dynamic"></asp:RequiredFieldValidator>
>> </EditItemTemplate>
>> </asp:TemplateColumn>
>>
>



Nov 18 '05 #5

P: n/a
Its a reasonable action to take. Its required on each new "domain" you
define.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:vb********************************@4ax.com...
running aspnet_regiis.exe -c from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
made the client side validation work.

Must I run the tool upon every new site that is created on the server?

On Tue, 30 Nov 2004 15:17:05 -0800, "Patrick.O.Ige"
<Pa*********@discussions.microsoft.com> wrote:
Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

"hansiman" wrote:
It's strange as the client side validation works fine on another site
on the same server. The working site runs as in a virtual folder under
the server's ip. The site not working is set up as an independent
site! Could this be the problem?

The folder "aspnet_client" only resides in my wwwroot folder. Could I
simply xcopy the aspnet_client folder to the new site's root?

Will running "aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]" cause changes to
existing sites?

Morten

On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <PL****@Blum.info>
wrote:

>Two possible problems.
>
>1. Client-side validation is not correctly setup.
>On the server, run this command (via cmd.exe):
>aspnet_regiis.exe -c
>from [windows]\microsoft.net\framework\[version]
>
>2. Server side validation has not been correctly coded.
>You must always check Page.IsValid is true in your post back event
>handler
>method before saving.
>
>--- Peter Blum
>www.PeterBlum.com
>Email: PL****@PeterBlum.com
>Creator of "Professional Validation And More" at
>http://www.peterblum.com/vam/home.aspx
>
>"hansiman" <ha***@hotmail.com> wrote in message
>news:8f********************************@4ax.com.. .
>> I'm having trouble getting the required field validator to work. I
>> can
>> still save the row in the datagrid... I can't see what I'm doing
>> wrong.
>>
>> <asp:TemplateColumn SortExpression="c.Password"
>> HeaderText="Password">
>> <ItemTemplate>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
>> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
>> </ItemTemplate>
>> <EditItemTemplate>
>> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
>> "DataItem.Password") %>' ID="txtPassword" Width="50">
>> </asp:TextBox>
>> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
>> ErrorMessage="*" ControlToValidate="txtPassword"
>> Display="Dynamic"></asp:RequiredFieldValidator>
>> </EditItemTemplate>
>> </asp:TemplateColumn>
>>
>

Nov 18 '05 #6

P: n/a
thanks for the insight

On Wed, 1 Dec 2004 13:15:44 -0500, "Peter Blum" <PL****@Blum.info>
wrote:
Its a reasonable action to take. Its required on each new "domain" you
define.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:vb********************************@4ax.com.. .
running aspnet_regiis.exe -c from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
made the client side validation work.

Must I run the tool upon every new site that is created on the server?

On Tue, 30 Nov 2004 15:17:05 -0800, "Patrick.O.Ige"
<Pa*********@discussions.microsoft.com> wrote:
Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

"hansiman" wrote:

It's strange as the client side validation works fine on another site
on the same server. The working site runs as in a virtual folder under
the server's ip. The site not working is set up as an independent
site! Could this be the problem?

The folder "aspnet_client" only resides in my wwwroot folder. Could I
simply xcopy the aspnet_client folder to the new site's root?

Will running "aspnet_regiis.exe -c
from [windows]\microsoft.net\framework\[version]" cause changes to
existing sites?

Morten

On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <PL****@Blum.info>
wrote:

>Two possible problems.
>
>1. Client-side validation is not correctly setup.
>On the server, run this command (via cmd.exe):
>aspnet_regiis.exe -c
>from [windows]\microsoft.net\framework\[version]
>
>2. Server side validation has not been correctly coded.
>You must always check Page.IsValid is true in your post back event
>handler
>method before saving.
>
>--- Peter Blum
>www.PeterBlum.com
>Email: PL****@PeterBlum.com
>Creator of "Professional Validation And More" at
>http://www.peterblum.com/vam/home.aspx
>
>"hansiman" <ha***@hotmail.com> wrote in message
>news:8f********************************@4ax.com.. .
>> I'm having trouble getting the required field validator to work. I
>> can
>> still save the row in the datagrid... I can't see what I'm doing
>> wrong.
>>
>> <asp:TemplateColumn SortExpression="c.Password"
>> HeaderText="Password">
>> <ItemTemplate>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
>> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
>> </ItemTemplate>
>> <EditItemTemplate>
>> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
>> "DataItem.Password") %>' ID="txtPassword" Width="50">
>> </asp:TextBox>
>> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
>> ErrorMessage="*" ControlToValidate="txtPassword"
>> Display="Dynamic"></asp:RequiredFieldValidator>
>> </EditItemTemplate>
>> </asp:TemplateColumn>
>>
>


Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.