473,387 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how can I add hyperlink to button?

I want a link button to perform two functions:

1. log off form authenticated user

2. navigate to another page

In the click event, I accomplished #1 with:
System.Web.Security.FormsAuthentication.SignOut().

What is code for the navigation?

Thanks.
Nov 19 '05 #1
5 2104
Hi Michael,

How about a Redirect?

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Response.Redirect("http://msdn.microsoft.com")
End Sub

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
I want a link button to perform two functions:

1. log off form authenticated user

2. navigate to another page

In the click event, I accomplished #1 with:
System.Web.Security.FormsAuthentication.SignOut().

What is code for the navigation?

Thanks.


Nov 19 '05 #2
The link button is in the contents frame of a frameset. The URL to which I
redirect opens in that frame. I want it to open in a full page, i.e. as a
hyperlink can have "_parent" as a target. Any ideas?

Thanks!

"Ken Cox [Microsoft MVP]" wrote:
Hi Michael,

How about a Redirect?

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Response.Redirect("http://msdn.microsoft.com")
End Sub

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
I want a link button to perform two functions:

1. log off form authenticated user

2. navigate to another page

In the click event, I accomplished #1 with:
System.Web.Security.FormsAuthentication.SignOut().

What is code for the navigation?

Thanks.


Nov 19 '05 #3
Hi Michael,

It's a bit of a hack, but I'd just jam in some Javascript to make it go to
the parent's frame:

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Page.RegisterStartupScript("redir", _
"<script>window.open('http://msdn.microsoft.com','_parent');</script>")
End Sub

Does that do it?

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
The link button is in the contents frame of a frameset. The URL to which I
redirect opens in that frame. I want it to open in a full page, i.e. as a
hyperlink can have "_parent" as a target. Any ideas?

Thanks!

"Ken Cox [Microsoft MVP]" wrote:
Hi Michael,

How about a Redirect?

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Response.Redirect("http://msdn.microsoft.com")
End Sub

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in
message
news:B2**********************************@microsof t.com...
>I want a link button to perform two functions:
>
> 1. log off form authenticated user
>
> 2. navigate to another page
>
> In the click event, I accomplished #1 with:
> System.Web.Security.FormsAuthentication.SignOut().
>
> What is code for the navigation?
>
> Thanks.



Nov 19 '05 #4
That works! I appreciate your help.

I was surprised there wasn't a control which combines hyperlink with click
event in code behind page.

Michael

"Ken Cox [Microsoft MVP]" wrote:
Hi Michael,

It's a bit of a hack, but I'd just jam in some Javascript to make it go to
the parent's frame:

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Page.RegisterStartupScript("redir", _
"<script>window.open('http://msdn.microsoft.com','_parent');</script>")
End Sub

Does that do it?

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
The link button is in the contents frame of a frameset. The URL to which I
redirect opens in that frame. I want it to open in a full page, i.e. as a
hyperlink can have "_parent" as a target. Any ideas?

Thanks!

"Ken Cox [Microsoft MVP]" wrote:
Hi Michael,

How about a Redirect?

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Response.Redirect("http://msdn.microsoft.com")
End Sub

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in
message
news:B2**********************************@microsof t.com...
>I want a link button to perform two functions:
>
> 1. log off form authenticated user
>
> 2. navigate to another page
>
> In the click event, I accomplished #1 with:
> System.Web.Security.FormsAuthentication.SignOut().
>
> What is code for the navigation?
>
> Thanks.


Nov 19 '05 #5
Hi Michael,

Glad that works for you.

I'll have to check whether what you need is coming in ASP.NET 2.0.

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
That works! I appreciate your help.

I was surprised there wasn't a control which combines hyperlink with click
event in code behind page.

Michael

"Ken Cox [Microsoft MVP]" wrote:
Hi Michael,

It's a bit of a hack, but I'd just jam in some Javascript to make it go
to
the parent's frame:

Private Sub LinkButton3_Click _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles LinkButton3.Click
System.Web.Security.FormsAuthentication.SignOut()
Page.RegisterStartupScript("redir", _

"<script>window.open('http://msdn.microsoft.com','_parent');</script>")
End Sub

Does that do it?

Ken
Microsoft MVP [ASP.NET]
Toronto

"MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in
message
news:C1**********************************@microsof t.com...
> The link button is in the contents frame of a frameset. The URL to
> which I
> redirect opens in that frame. I want it to open in a full page, i.e. as
> a
> hyperlink can have "_parent" as a target. Any ideas?
>
> Thanks!
>
> "Ken Cox [Microsoft MVP]" wrote:
>
>> Hi Michael,
>>
>> How about a Redirect?
>>
>> Private Sub LinkButton3_Click _
>> (ByVal sender As System.Object, ByVal e As System.EventArgs) _
>> Handles LinkButton3.Click
>> System.Web.Security.FormsAuthentication.SignOut()
>> Response.Redirect("http://msdn.microsoft.com")
>> End Sub
>>
>> Ken
>> Microsoft MVP [ASP.NET]
>> Toronto
>>
>> "MichaelCaditz" <Mi***********@discussions.microsoft.com> wrote in
>> message
>> news:B2**********************************@microsof t.com...
>> >I want a link button to perform two functions:
>> >
>> > 1. log off form authenticated user
>> >
>> > 2. navigate to another page
>> >
>> > In the click event, I accomplished #1 with:
>> > System.Web.Security.FormsAuthentication.SignOut().
>> >
>> > What is code for the navigation?
>> >
>> > Thanks.
>>
>>



Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pat | last post by:
All, What I want to do: ******************* Click on a hyperlink in the last column in a datagrid, have it grab a value in the fourth column in the same row and send it to the codehind into a...
1
by: Joshua Weir | last post by:
Hi, I want to simply add hyperlink functionality to a normal web control button. I understand that i can use the hyperlink button for this but in this case i dont want to do this. Say i have...
0
by: Waran | last post by:
Hi, In a datagrid I am displaying 2 columns. One is a Hyperlink Colum and the other is a Button Column. The values for the hyperlink columns are fetched from the database and its a url. When I...
4
by: wrytat | last post by:
I have a form with a textbox for the user to enter a quantity and another textbox for the delivery date. I disabled this delivery date textbox such that the user has to press a calendar link next...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
4
by: sulemanzia | last post by:
I have a form with a Command button. i have a text box also which is bound to my Button. i have created a standard module and created an onclick event for my button which is something like this (...
2
by: =?Utf-8?B?Q2hhcnRz?= | last post by:
I have been writing C# programs to spider yellow page to get list of restaurant name, address to the database. When I encounter button or hyperlink, I don’t know how to use the program to click...
6
by: vspsdca | last post by:
Hi, I'm a newbie here and does not really have any formal training on VBA. I just need help to get my hyperlink to work. I have a form in MS Access with a browse button where a user can select a...
1
by: sivasrec | last post by:
Hi, This is sivakumar from India. Now I am learning to ASP.NET 2.0.. I have a doubt.... I have used in a one hidden field control, 2 label controls, 2 button controls and...
10
by: sierra7 | last post by:
I'm trying to create a form where a user enters a document reference number and then clicks a command button to add a hyperlink to the document, via a file picker. Thanks to Adezii's excellent...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.