how to pass value along with click of a button

  • Thread starter Thread starter Al
  • Start date Start date
A

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
 
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)
 
Back
Top