469,568 Members | 1,394 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

how to pass value along with click of a button

Al
Ref:how to pass value along with click of a button
hi,I have created a form that has single button. as follow
<asp:button id="btnCallfunction" runat="server"
text="func_call" onclick="add_int" />

Sub func_call(Source As Object, E As EventArgs)
' how to capture the passed variable here

end Sub

This works if I am calling it from another function, but
caused me an error when I call it from the above btn
Error is Method 'Public fun_call(strid as integer does not
have the same signature as delegate "Delegate Sub
EventHandler(sender as Object, e AS system.EventArgs)

Sub func_call(strid as integer)
dim vid = strid
process vid
end sub

So what can I do if I want to call a function by clicking
a button in asp.net form and pass a value to the function
to process it.thanks for your help.
Al
Jul 21 '05 #1
1 1536
Store it as a Session variable, your function/sub can referernce it from
there.... Session("SomeStorage") = WhateverYouWantBehindClick

Then to dereference it:

SomeObject = CTYPE(Session("SomeStorage"), SomeObjectsType)
"Al" <aa********@yahoo.com> wrote in message
news:0f****************************@phx.gbl...
Ref:how to pass value along with click of a button
hi,I have created a form that has single button. as follow
<asp:button id="btnCallfunction" runat="server"
text="func_call" onclick="add_int" />

Sub func_call(Source As Object, E As EventArgs)
' how to capture the passed variable here

end Sub

This works if I am calling it from another function, but
caused me an error when I call it from the above btn
Error is Method 'Public fun_call(strid as integer does not
have the same signature as delegate "Delegate Sub
EventHandler(sender as Object, e AS system.EventArgs)

Sub func_call(strid as integer)
dim vid = strid
process vid
end sub

So what can I do if I want to call a function by clicking
a button in asp.net form and pass a value to the function
to process it.thanks for your help.
Al

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Sharon | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.