Click here to Skip to main content
15,890,123 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: using javascript to check validation in aspx page Pin
Abhijit Jana3-Dec-09 0:21
professionalAbhijit Jana3-Dec-09 0:21 
GeneralRe: using javascript to check validation in aspx page Pin
Anurag Gandhi3-Dec-09 0:27
professionalAnurag Gandhi3-Dec-09 0:27 
GeneralRe: using javascript to check validation in aspx page Pin
Member 47041433-Dec-09 0:30
Member 47041433-Dec-09 0:30 
GeneralRe: using javascript to check validation in aspx page Pin
Abhijit Jana3-Dec-09 0:50
professionalAbhijit Jana3-Dec-09 0:50 
GeneralRe: using javascript to check validation in aspx page Pin
Abhishek Sur3-Dec-09 0:57
professionalAbhishek Sur3-Dec-09 0:57 
GeneralRe: using javascript to check validation in aspx page Pin
Abhijit Jana3-Dec-09 1:06
professionalAbhijit Jana3-Dec-09 1:06 
GeneralRe: using javascript to check validation in aspx page Pin
Abhishek Sur3-Dec-09 1:07
professionalAbhishek Sur3-Dec-09 1:07 
AnswerRe: using javascript to check validation in aspx page Pin
Abhishek Sur3-Dec-09 1:00
professionalAbhishek Sur3-Dec-09 1:00 
The only problem that I see in your code is runat="server" in the script block.

If you specify a script block as runat="server" it will take it as C# / VB.NET block based on the language.

So remove the runat = server and also use
OnClientClick to define javascript block.

use this :
<asp:Button ID="Button1" runat="server" Text="Button"  OnClientClick="javascript:checkValue2(this)" /> 

<script type="text/javascript" >
function checkValue2( obj)
{
    if (obj.value == "")
        alert ("empty");
    else
        alert ("not empty");
}
</script>


this will work. Wink | ;)

Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript

GeneralRe: using javascript to check validation in aspx page Pin
Member 47041433-Dec-09 16:37
Member 47041433-Dec-09 16:37 
GeneralRe: using javascript to check validation in aspx page Pin
Anurag Gandhi3-Dec-09 17:22
professionalAnurag Gandhi3-Dec-09 17:22 
QuestionFreezeHeader Pin
Anurag Gandhi3-Dec-09 0:00
professionalAnurag Gandhi3-Dec-09 0:00 
AnswerRe: FreezeHeader Pin
Abhijit Jana3-Dec-09 0:02
professionalAbhijit Jana3-Dec-09 0:02 
GeneralRe: FreezeHeader Pin
Anurag Gandhi3-Dec-09 0:23
professionalAnurag Gandhi3-Dec-09 0:23 
GeneralRe: FreezeHeader Pin
Abhijit Jana3-Dec-09 0:34
professionalAbhijit Jana3-Dec-09 0:34 
AnswerRe: FreezeHeader Pin
Abhishek Sur3-Dec-09 0:52
professionalAbhishek Sur3-Dec-09 0:52 
GeneralRe: FreezeHeader Pin
Anurag Gandhi3-Dec-09 0:56
professionalAnurag Gandhi3-Dec-09 0:56 
QuestionGreyBox Problem..... Pin
Anudeep Jaiswal2-Dec-09 23:31
Anudeep Jaiswal2-Dec-09 23:31 
Questionproblem in finding if textbox is selected or not Pin
ansriharsha2-Dec-09 23:06
ansriharsha2-Dec-09 23:06 
AnswerRe: problem in finding if textbox is selected or not Pin
Abhishek Sur3-Dec-09 0:44
professionalAbhishek Sur3-Dec-09 0:44 
GeneralRe: problem in finding if textbox is selected or not Pin
ansriharsha3-Dec-09 1:59
ansriharsha3-Dec-09 1:59 
GeneralRe: problem in finding if textbox is selected or not Pin
Abhishek Sur3-Dec-09 3:00
professionalAbhishek Sur3-Dec-09 3:00 
AnswerRe: problem in finding if textbox is selected or not Pin
ansriharsha8-Dec-09 18:00
ansriharsha8-Dec-09 18:00 
QuestionClassic ASP ConnectionString? Pin
hifiger20042-Dec-09 21:56
hifiger20042-Dec-09 21:56 
AnswerRe: Classic ASP ConnectionString? Pin
Abhijit Jana2-Dec-09 22:10
professionalAbhijit Jana2-Dec-09 22:10 
AnswerRe: Classic ASP ConnectionString? Pin
Appusamy.subbian2-Dec-09 23:26
Appusamy.subbian2-Dec-09 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.