Click here to Skip to main content
15,891,748 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionlocalize menu control in ASP.net 2.0 Pin
Rajesh_K_Sharma3-Nov-07 19:12
Rajesh_K_Sharma3-Nov-07 19:12 
QuestionError with ASP.NET 2.0 Pin
nickabradley3-Nov-07 10:26
nickabradley3-Nov-07 10:26 
AnswerRe: Error with ASP.NET 2.0 Pin
pmarfleet3-Nov-07 11:00
pmarfleet3-Nov-07 11:00 
GeneralRe: Error with ASP.NET 2.0 Pin
nickabradley3-Nov-07 12:00
nickabradley3-Nov-07 12:00 
QuestionRuntime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 9:17
Dot Net Jantu3-Nov-07 9:17 
AnswerRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 9:24
pmarfleet3-Nov-07 9:24 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 9:34
Dot Net Jantu3-Nov-07 9:34 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 9:49
pmarfleet3-Nov-07 9:49 
Dot Net Jantu wrote:
How do we do that? Like this?

AddHandler btnSave.Click, btnhandler_click(ByVal sender As Object, ByVal e As EventArgs)

this code give me error as "expression expected" by underlining the ByVal

And where do we do that?


Did you read the article? The sample code shows you how to dynamically assign an event handler to an event. You're code doesn't look anything like that in the article so it's not surprising that it doesn't work. I suggest that you implement your code in line with the article instead of just making up something that isn't even syntactically correct.

Dot Net Jantu wrote:
Public Sub btnhandler_click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click
Response.Write("clicked")
End Sub


The Handles keyword is unnecessary if the event handler is only being used for controls that are created dynamically. However, if you have a control called btnSave defined in your ASPX page then you would want to use it.

Paul Marfleet

"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush


GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 10:01
Dot Net Jantu3-Nov-07 10:01 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 10:20
pmarfleet3-Nov-07 10:20 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 10:30
Dot Net Jantu3-Nov-07 10:30 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 10:48
pmarfleet3-Nov-07 10:48 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 11:06
Dot Net Jantu3-Nov-07 11:06 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 11:12
pmarfleet3-Nov-07 11:12 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 11:20
Dot Net Jantu3-Nov-07 11:20 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 11:29
pmarfleet3-Nov-07 11:29 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Dot Net Jantu3-Nov-07 19:45
Dot Net Jantu3-Nov-07 19:45 
GeneralRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
pmarfleet3-Nov-07 23:05
pmarfleet3-Nov-07 23:05 
AnswerRe: Runtime Creation Of Button+Adding Events+Sourabh Pin
Christian Graus3-Nov-07 12:19
protectorChristian Graus3-Nov-07 12:19 
QuestionPassing argument to function Pin
csinva3-Nov-07 8:36
csinva3-Nov-07 8:36 
AnswerRe: Passing argument to function Pin
pmarfleet3-Nov-07 9:03
pmarfleet3-Nov-07 9:03 
GeneralRe: Passing argument to function Pin
csinva3-Nov-07 9:12
csinva3-Nov-07 9:12 
GeneralRe: Passing argument to function Pin
pmarfleet3-Nov-07 9:21
pmarfleet3-Nov-07 9:21 
AnswerRe: Passing argument to function Pin
Guffa3-Nov-07 9:27
Guffa3-Nov-07 9:27 
AnswerRe: Passing argument to function Pin
Guffa3-Nov-07 9:12
Guffa3-Nov-07 9:12 

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.