How to call Server side Function from client side function ?

I

Ing. Rajesh Kumar

Hi everybody
I want to solve the following problem :
I have some panels on a web page. User select which one is visible or hidden. When a panel is visible and user clicks on the web page but outside of that panel then I want to call a function to hide visible panel(s).

I am calling server functions by the following code but does not work ?

Sub Server_Function(sender as Object, e as EventArgs)
'Clean web page
End sub

<script language="JavaScript">
function left_mouse_button() {
if (event.button==1 && somePanel.Visible == true)
{ <% Server_Function() %> }
}
document.onmousedown = left_mouse_button
</script>

Thanks in advance
Raja
 
J

Jim Cheshire [MSFT]

Raja,

There isn't a real simple way of doing this. You can use XMLHttp or you
can use remote scripting. There are some .NET remote scripting components
available from third-parties. You can do a search on the Internet and you
should turn up a few.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
(e-mail address removed)

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
From: "Ing. Rajesh Kumar" <[email protected]>
Subject: How to call Server side Function from client side function ?
Date: Sun, 28 Mar 2004 16:18:03 +0200
Lines: 80
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0008_01C414E0.3EC78730"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet,microsoft.public.in.aspdotnet,micro
soft.public.in.dotnet,microsoft.public.in.dotnet.framework,microsoft.public.
in.vbdotnet
NNTP-Posting-Host: a191-171.dialup.iol.cz 194.228.171.191
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.in.aspdotnet:9153
microsoft.public.in.dotnet:1753 microsoft.public.in.dotnet.framework:2303
microsoft.public.in.vbdotnet:7032
microsoft.public.dotnet.framework.aspnet:222369
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi everybody
I want to solve the following problem :
I have some panels on a web page. User select which one is visible or
hidden. When a panel is visible and user clicks on the web page but outside
of that panel then I want to call a function to hide visible panel(s).
 
H

Hugo Wetterberg

Register a hidden field in page_load and use it to flag panel
visibility settings. Use javascript to set the value of the field and
submit the form.

The you check the value of the hidden field in subsequent postbacks
and change the panel visibility accordingly.

/Hugo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top