Home All Groups Group Topic Archive Search About
Author
28 Mar 2005 3:23 PM
Xarky
Hi,

I have the following piece of code. In reality it is a menu which has
more options.  The main idea was taken from the following link.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_fp2003_ta/html/OfficeFrontPageCreateDropDownMenu.asp


<table class="navbar" width="100%">
<tr>
   <td class="menuNormal" width="20%">
      <p>Sign out</p>
   </td>
</tr>
</table>

On the sign out option I require an onmousedown() event, that when
fires, does the following operations.

{
   Session["UserID"] = "";
   Response.Redirect(...to login page);
}


Can someone help me doing it.
Thanks in Advance

Author
28 Mar 2005 3:50 PM
Marina
onmousedown is a client side event. You can't have server side code firing
on a client side event, unless there is client side code to call the server.

In general, asp.net questions should be asked in the aspnet forum.

Show quoteHide quote
"Xarky" <bernardp***@yahoo.com> wrote in message
news:bc42e1a.0503280723.73119187@posting.google.com...
> Hi,
>
> I have the following piece of code. In reality it is a menu which has
> more options.  The main idea was taken from the following link.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_fp2003_ta/html/OfficeFrontPageCreateDropDownMenu.asp
>
>
> <table class="navbar" width="100%">
> <tr>
>   <td class="menuNormal" width="20%">
>      <p>Sign out</p>
>   </td>
> </tr>
> </table>
>
> On the sign out option I require an onmousedown() event, that when
> fires, does the following operations.
>
> {
>   Session["UserID"] = "";
>   Response.Redirect(...to login page);
> }
>
>
> Can someone help me doing it.
> Thanks in Advance
Are all your drivers up to date? click for free checkup

Author
28 Mar 2005 4:16 PM
Ignacio Machin ( .NET/ C# MVP )
Hi,

You should better use a button for that.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Show quoteHide quote
"Xarky" <bernardp***@yahoo.com> wrote in message
news:bc42e1a.0503280723.73119187@posting.google.com...
> Hi,
>
> I have the following piece of code. In reality it is a menu which has
> more options.  The main idea was taken from the following link.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_fp2003_ta/html/OfficeFrontPageCreateDropDownMenu.asp
>
>
> <table class="navbar" width="100%">
> <tr>
>   <td class="menuNormal" width="20%">
>      <p>Sign out</p>
>   </td>
> </tr>
> </table>
>
> On the sign out option I require an onmousedown() event, that when
> fires, does the following operations.
>
> {
>   Session["UserID"] = "";
>   Response.Redirect(...to login page);
> }
>
>
> Can someone help me doing it.
> Thanks in Advance
Author
28 Mar 2005 5:29 PM
Sharon
You could use javascript to redirect to a page
that handles the logout.
It is also possible to do it on the server side.
Web controls such as LinkButton, support Click event.
But then you'll have to populate the menu on the server side.


"Xarky" <bernardp***@yahoo.com> wrote in message
news:bc42e1a.0503280723.73119187@posting.google.com...
> Hi,
>
> I have the following piece of code. In reality it is a menu which has
> more options.  The main idea was taken from the following link.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_fp2003_
ta/html/OfficeFrontPageCreateDropDownMenu.asp
Show quoteHide quote
>
>
> <table class="navbar" width="100%">
> <tr>
>    <td class="menuNormal" width="20%">
>       <p>Sign out</p>
>    </td>
> </tr>
> </table>
>
> On the sign out option I require an onmousedown() event, that when
> fires, does the following operations.
>
> {
>    Session["UserID"] = "";
>    Response.Redirect(...to login page);
> }
>
>
> Can someone help me doing it.
> Thanks in Advance
Author
29 Mar 2005 6:08 AM
xarky d_best
Hi

I tried it with the following code, and it worked. But is this the
correct way to do it?

<a href=Login.aspx onmousedown="<% Session["UserID"] = "";%>">



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Author
29 Mar 2005 9:24 AM
Sharon
No it doesn't work.
This line logs the user out, every time the page is accessed.
You really need a better understanding of client / server programming.
Try this:
<a href="Logout.aspx" >Logout</a>
Logout.aspx should contain this line: Session["UserID"] = "";

Show quoteHide quote
"xarky d_best" <bernardp***@yahoo.com> wrote in message
news:#cBPKXCNFHA.3960@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I tried it with the following code, and it worked. But is this the
> correct way to do it?
>
> <a href=Login.aspx onmousedown="<% Session["UserID"] = "";%>">
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Bookmark and Share