required field validator

H

hansiman

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>
 
P

Peter Blum

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
H

hansiman

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

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

hansiman said:
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>
 
G

Guest

Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

hansiman said:
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

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

hansiman said:
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>
 
H

hansiman

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?

Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

hansiman said:
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

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

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>
 
P

Peter Blum

Its a reasonable action to take. Its required on each new "domain" you
define.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

hansiman said:
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?

Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

hansiman said:
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

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

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>
 
H

hansiman

thanks for the insight

Its a reasonable action to take. Its required on each new "domain" you
define.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

hansiman said:
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?

Hanisman..just run the command on the PC thats not working..
GDLUCK
Patrick

:

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

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top