[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

OnClick event does not work when using RequiredFieldValidator Control

Posted on 2005-05-05
14
Medium Priority
?
788 Views
Last Modified: 2007-12-19
I have this same code on a page on Intranet site and a page on Internet site, the one on the intranet site works fine, but the one on internet site doesn't work (when I click the submit button, the onclick event doesn't do anthing, nothing happen). I think there is something going on with the setting up with the project, but I don't know what it is. Please help! Thanks.

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<SCRIPT RUNAT="SERVER">

Sub btnSubmit_Click (obj As Object, e As EventArgs)
Response.Write ("Valid")
End Sub

</Script>
<HTML>
<HEAD>
<title>Login</title>
</HEAD>
<body>
<form Runat="Server" id=form1>
<TABLE WIDTH="90%" BORDER="0" CELLSPACING="1" CELLPADDING="1">
<TR>
<TD colSpan="4">&nbsp;<BR>
<FONT face="Arial" color="#006600" size="2"><STRONG>Return user? Please login</STRONG></FONT></TD>
</TR>
<TR>
<TD><FONT face="Arial"><FONT size="2"><STRONG>Username:<FONT color="#cc0033">*</FONT></STRONG></FONT></FONT></TD>
<TD>
<asp:TextBox ID="txtUserName" MaxLength="10" Runat="Server"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="txtUserName" Text="The Username field is missing." Runat="server"></asp:RequiredFieldValidator>
<FONT face="Arial" size="2"></FONT>
</TD>
</TR>
<TR>
<TD><FONT face="Arial"><FONT size="2"><STRONG>Password:<FONT color="#cc0033">*</FONT></STRONG></FONT></FONT></TD>
<TD>
<asp:TextBox ID="txtPassword" MaxLength="10" Runat="Server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="txtPassword" Text="The password field is missing." Runat="server"></asp:RequiredFieldValidator><FONT face="Arial" size="2"></FONT>
</TD>
</TR>
<TR>
<TD colspan="4">&nbsp;<BR>
<asp:button
onclick="btnSubmit_Click"
text="Submit Form!" runat="server" ID="Button1"/>
</TD>
</TR>
</TABLE>
</form>
</body>
</HTML>
0
Comment
Question by:CochiseCounty
  • 7
  • 5
  • 2
14 Comments
 
LVL 15

Expert Comment

by:praneetha
ID: 13938294
so when u remove req field validtaor it works..

may ushoudl try running asp_regiis
0
 

Author Comment

by:CochiseCounty
ID: 13938321
Yes, when I remove the field validator, the page works fine.

What is asp_regiis and how to run it? Thanks.
0
 
LVL 15

Expert Comment

by:praneetha
ID: 13938334
http://support.microsoft.com/default.aspx?scid=kb;en-us;306005

To fix IIS mappings for ASP.NET, run the Aspnet_regiis.exe utility:
1.      Click Start, and then click Run.
2.      In the Open text box, type cmd, and then press ENTER.
3.      At the command prompt, type the following, and then press ENTER:
"%windir%\Microsoft.NET\Framework\version\aspnet_regiis.exe" -i
In this path, version represents the version number of the .NET Framework that you installed on your server. You must replace this placeholder with the actual version number when you ty

try that
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:CochiseCounty
ID: 13938545
I ran it, but it still not work.
0
 
LVL 15

Expert Comment

by:praneetha
ID: 13938556
C:\Inetpub\wwwroot\aspnet_client do u have the

aspnet_client folder in the IIS virtual folder...

try restarting the IIS or the computer
0
 

Author Comment

by:CochiseCounty
ID: 13938661
I just have Visual Studio.NET installed in my personal computer, not on the web server. What should I do?
0
 
LVL 12

Expert Comment

by:laotzi2000
ID: 13938689
You can try run
aspnet_regiis -c
to repair client scripts on the SERVER.
0
 

Author Comment

by:CochiseCounty
ID: 13938763
I ran this in my local computer command prompt

"%windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe" -c

and received this

An error has occurred <0x80070003>
0
 
LVL 12

Expert Comment

by:laotzi2000
ID: 13938901
strange.

By the way, did you use IE to view the page?
0
 

Author Comment

by:CochiseCounty
ID: 13939156
Yes.
The funny thing is it works with the intranet site. This is the second Net web project I created. The first one is on the intranet, this is on the internet.
0
 

Author Comment

by:CochiseCounty
ID: 13939217
I check my web server, I saw the folder aspnet_client there. So what is wrong now. Please help. Thanks.
0
 
LVL 15

Accepted Solution

by:
praneetha earned 1000 total points
ID: 13939219
run the aspnet_regiis on the server..not on local computer...

0
 

Author Comment

by:CochiseCounty
ID: 13939322
Yeah, it works now. THANKS A MILLION!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month19 days, 9 hours left to enroll

873 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