Click here to Skip to main content
15,895,777 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Search a string in a paragraph Pin
.NET- India 26-Nov-07 1:45
.NET- India 26-Nov-07 1:45 
GeneralRe: Search a string in a paragraph Pin
InsDev26-Nov-07 1:50
InsDev26-Nov-07 1:50 
GeneralRe: Search a string in a paragraph Pin
.NET- India 26-Nov-07 1:52
.NET- India 26-Nov-07 1:52 
GeneralRe: Search a string in a paragraph Pin
InsDev26-Nov-07 1:56
InsDev26-Nov-07 1:56 
GeneralRe: Search a string in a paragraph Pin
.NET- India 26-Nov-07 2:03
.NET- India 26-Nov-07 2:03 
Questionhow to view the last of a grid view when it is kept in a panel Pin
jagadeeshkumar198426-Nov-07 1:13
jagadeeshkumar198426-Nov-07 1:13 
QuestionHow to call a javascript function in code behind using href..? Pin
Balagurunathan S26-Nov-07 1:05
Balagurunathan S26-Nov-07 1:05 
AnswerRe: How to call a javascript function in code behind using href..? Pin
Sun Rays26-Nov-07 1:26
Sun Rays26-Nov-07 1:26 
Balagurunathan S wrote:
I am having a .aspx page with many controls in it.I have a text for logging out from my application.When the user clicks that "LogOut" text,he should be logged out from my application.I have written javascript function in Code behind to log out.How to call the javascript function in code behind by using href property of the text(Logout)..i.e when the user clicks the "Logout" text,the javascript function in code behind should be called..



For this,

ClientScript.RegisterClientScriptBlock(GetType(), "test", "<script text='text/javascript'> alert('test');</script>");


Balagurunathan S wrote:
Moreover,another issue is that if the user closes the page without even logging out from my application,i need to call the same javascript function in the code behind whenever he attempts to close the page by clicking the close button in the page.



to call function close window you can do this.

    <script type="text/javascript"><br />
    <br />
    function doUnload()<br />
{<br />
<br />
if (window.event.clientX < 0 && window.event.clientY < 0)<br />
{<br />
alert("Window is closing...");<br />
}<br />
}<br />
    </script>


Call on body's UnLoad event.
<body onunload="doUnload();"><br />






Thanks,
Sun Rays

To get something you must have to try once.


My Articles

GeneralRe: How to call a javascript function in code behind using href..? Pin
Balagurunathan S26-Nov-07 1:58
Balagurunathan S26-Nov-07 1:58 
GeneralRe: How to call a javascript function in code behind using href..? Pin
Balagurunathan S26-Nov-07 2:02
Balagurunathan S26-Nov-07 2:02 
GeneralRe: How to call a javascript function in code behind using href..? Pin
Sun Rays26-Nov-07 18:28
Sun Rays26-Nov-07 18:28 
AnswerRe: How to call a javascript function in code behind using href..? Pin
NanaAM26-Nov-07 1:35
NanaAM26-Nov-07 1:35 
AnswerRe: How to remove “+” sign in tree view control at child node Pin
Venkatesh Mookkan26-Nov-07 1:00
Venkatesh Mookkan26-Nov-07 1:00 
GeneralRe: How to remove “+” sign in tree view control at child node Pin
Rajesh_K_Sharma26-Nov-07 14:02
Rajesh_K_Sharma26-Nov-07 14:02 
Questionconnecting sqlexpress 2005 and visual studio 2005 Pin
justintimberlake26-Nov-07 0:14
justintimberlake26-Nov-07 0:14 
AnswerRe: connecting sqlexpress 2005 and visual studio 2005 Pin
Braulio Dez26-Nov-07 3:45
Braulio Dez26-Nov-07 3:45 
QuestionHow much an navigation URL may be weighted. Pin
KANGAROO_26-Nov-07 0:07
KANGAROO_26-Nov-07 0:07 
AnswerRe: How much an navigation URL may be weighted. Pin
_AK_26-Nov-07 0:14
_AK_26-Nov-07 0:14 
GeneralRe: How much an navigation URL may be weighted. Pin
KANGAROO_26-Nov-07 0:29
KANGAROO_26-Nov-07 0:29 
GeneralRe: How much an navigation URL may be weighted. Pin
_AK_26-Nov-07 0:36
_AK_26-Nov-07 0:36 
GeneralRe: How much an navigation URL may be weighted. Pin
KANGAROO_26-Nov-07 1:07
KANGAROO_26-Nov-07 1:07 
GeneralRe: How much an navigation URL may be weighted. Pin
_AK_26-Nov-07 1:22
_AK_26-Nov-07 1:22 
AnswerRe: How much an navigation URL may be weighted. Pin
pmarfleet26-Nov-07 0:16
pmarfleet26-Nov-07 0:16 
QuestionSession problem in server..., Pin
Member 387988126-Nov-07 0:06
Member 387988126-Nov-07 0:06 
AnswerRe: Session problem in server..., Pin
Sam Xavier26-Nov-07 4:08
Sam Xavier26-Nov-07 4:08 

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.