Click here to Skip to main content
15,904,926 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two problems with javascript.I am using asp.net with c#.
1)I want to open a popup that shows some message after execution some code clicking on a button.But javascript alert method opens popup when i click the button i.e,before executing the code.
2)how to make a table visible or invisible on mouseover through javascript.I have tried this,though the table is hidden,yet its background remains mouseover sensitive.
Posted
Comments
Prasad_Kulkarni 15-Mar-12 3:40am    
can you give code example

1 solution

Hi,

1st Problem:

write below code at button click event after executing your code:

C#
ScriptManager.RegisterStartUpScript(this,this.GetType(),"MyScript", "alert('Inserted Successfully');", true);


2nd Problem

set style of table

HTML
style="display:block"

then call a JS function onMouseOver event

in JS

JavaScript
if(document.getElementById('TableID').style.display == 'block')
{
document.getElementById('TableID').style.display = 'none';
}
else if(document.getElementById('TableID').style.display == 'none')
{
document.getElementById('TableID').style.display = 'block';
}
 
Share this answer
 
Comments
souvikcode 15-Mar-12 11:57am    
RegisterStartUpScript does not work.It shows an error

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