Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
On submit button I have user validation to enter user id so that then can submit.
I have used javascript to show alert box.
Code:
ScriptManager.RegisterStartupScript(this, typeof(Page), "script", "alert('Please, enter valid User id.');", true);

It works fine. Then i click on one of the link to go to other page. Come back to main page.
I get alert showing Please, enter valid User id. , without clicking on submit button.

Help me out.

I view sourced it.
I found at bottom of page, as:
XML
<script type="text/javascript">
//<![CDATA[
alert('Please, enter valid User id.');//]]>
</script>


which i didn't created it.
Posted
Comments
kk2014 26-Apr-13 7:08am    
have u given your button as a default button in your form somewhere?
Sant Osha 26-Apr-13 7:35am    
no
kk2014 26-Apr-13 7:38am    
ok. where did you put your ScriptManager.RegisterStartupScript(this, typeof(Page), "script", "alert('Please, enter valid User id.');", true); ???
Sant Osha 26-Apr-13 7:39am    
button click event
kk2014 26-Apr-13 7:40am    
can you paste your code here. so i can check and revert back to you...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900