Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > LinkButton behaviour

Reply
Thread Tools

LinkButton behaviour

 
 
Erik Cruz
Guest
Posts: n/a
 
      05-23-2004
Hi.

By an accident, I found a strange behaviour from Linkbuttons I could not
understand. I put a Linkbutton inside a Repeater. For this Linkbutton I
created an onClick event, this way:

<asp:linkbutton id="lnkUpdate" onClick="RunUpdate"></asp:linkbutton>

The RunUpdate routine is in my code-behind file. When I click the Linkbutton
it runs the code on the server. Shouldn't it run a client script routine? I
noticed that a Linkbutton does not show a onServerClick event, so, onClick
will run on both server and client sides?

TIA,
Erik Cruz


 
Reply With Quote
 
 
 
 
Calvin Luttrell/ProjectThunder.com
Guest
Posts: n/a
 
      05-24-2004
Erik,

Try giving your Linkbutton a command name then if it is in your repeater is should fire this event. For client code to run you can use the Attrubites Property of the Link Button to add the JavaScript or whatever client script. I don't know about doing both. You may have to disable the autopostback on that control. You'll have to test it.

-Calvin Luttrell
ProjectThunder.com


LinkButton1.Attributes.Add("OnClick", "DoSomethingJava;")


Private Sub Repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs ) Handles Repeater1.ItemCommand

If e.CommandName = "GO" Then

'Go do something, do it now, do it now!

End If

End Sub




> By an accident, I found a strange behaviour from Linkbuttons I could not
> understand. I put a Linkbutton inside a Repeater. For this Linkbutton I
> created an onClick event, this way:
>
> <asp:linkbutton id="lnkUpdate" onClick="RunUpdate"></asp:linkbutton>
>
> The RunUpdate routine is in my code-behind file. When I click the Linkbutton
> it runs the code on the server. Shouldn't it run a client script routine? I
> noticed that a Linkbutton does not show a onServerClick event, so, onClick
> will run on both server and client sides?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
debugger behaviour different to execution behaviour Andy Chambers Java 1 05-14-2007 09:51 AM
Linkbutton does not look like a linkbutton Sathyaish ASP .Net 3 09-08-2005 09:41 AM
Linkbutton does not look like a linkbutton Sathyaish ASP .Net Datagrid Control 1 09-08-2005 08:44 AM
asp:linkbutton - commandname behaviour John Blair ASP .Net 2 12-30-2004 05:04 PM
User Control + <asp:LinkButton> = JavaScript Error Fresh Air Rider ASP .Net 0 03-02-2004 10:34 PM



Advertisments