is there a way to pass values using the eventargs of a certain event, lets
say onclick?? or how does everyone else pass values? lets say each button
has 5 things (string, ints, etc) it needs to know, how can you pass that to
the event handler?One option is to utilize the commandarguments argument.
it's a read write property of the control retrievable thru event args ex.
e.commandname
"memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> is there a way to pass values using the eventargs of a certain event, lets
> say onclick?? or how does everyone else pass values? lets say each button
> has 5 things (string, ints, etc) it needs to know, how can you pass that
to
> the event handler?
"Alvin Bruney" <vapordan_spam_me_not@.hotmail_no_spamhotmail.com> wrote in
message news:edMGAILRDHA.3144@.tk2msftngp13.phx.gbl...
> One option is to utilize the commandarguments argument.
> it's a read write property of the control retrievable thru event args ex.
> e.commandname
> "memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
> news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> > is there a way to pass values using the eventargs of a certain event,
lets
> > say onclick?? or how does everyone else pass values? lets say each
button
> > has 5 things (string, ints, etc) it needs to know, how can you pass that
> to
> > the event handler?
I have used that but it wont solve my problem right now (actually not my
problem, someone elses) because they are using the onlick event of something
other than a button, and it does not have the command event.
Some .Net Event classes contain data in them. It sounds like you might need
to create a custom Event Class and Event Handler delegate, in order to pass
the data you specifically need. Is that correct?
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.
"memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> is there a way to pass values using the eventargs of a certain event, lets
> say onclick?? or how does everyone else pass values? lets say each button
> has 5 things (string, ints, etc) it needs to know, how can you pass that
to
> the event handler?
"Kevin Spencer" <kevin@.SPAMMERSSUCKtakempis.com> wrote in message
news:OnHHN2LRDHA.940@.TK2MSFTNGP11.phx.gbl...
> Some .Net Event classes contain data in them. It sounds like you might
need
> to create a custom Event Class and Event Handler delegate, in order to
pass
> the data you specifically need. Is that correct?
> HTH,
> Kevin Spencer
> Microsoft FrontPage MVP
> Internet Developer
> http://www.takempis.com
> Some things just happen.
> Everything else occurs.
> "memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
> news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> > is there a way to pass values using the eventargs of a certain event,
lets
> > say onclick?? or how does everyone else pass values? lets say each
button
> > has 5 things (string, ints, etc) it needs to know, how can you pass that
> to
> > the event handler?
that would probably actually work (had considered similar scenarios), i just
hope i can convince the person needing that thats the way to go.
What about creating a class that extends lets say htmlanchor and on the
onclick event it passes something on the event args, or it has some
properties that can be read/write?
As to whether you can successfully override an event handler for an existing
class, you would have to check that class to find out. It's not hard to
create a custom Server Control either.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.
"memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
news:vUjOa.648127$vU3.216888@.news1.central.cox.net ...
> "Kevin Spencer" <kevin@.SPAMMERSSUCKtakempis.com> wrote in message
> news:OnHHN2LRDHA.940@.TK2MSFTNGP11.phx.gbl...
> > Some .Net Event classes contain data in them. It sounds like you might
> need
> > to create a custom Event Class and Event Handler delegate, in order to
> pass
> > the data you specifically need. Is that correct?
> > HTH,
> > Kevin Spencer
> > Microsoft FrontPage MVP
> > Internet Developer
> > http://www.takempis.com
> > Some things just happen.
> > Everything else occurs.
> > "memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
> > news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> > > is there a way to pass values using the eventargs of a certain event,
> lets
> > > say onclick?? or how does everyone else pass values? lets say each
> button
> > > has 5 things (string, ints, etc) it needs to know, how can you pass
that
> > to
> > > the event handler?
> > > that would probably actually work (had considered similar scenarios), i
just
> hope i can convince the person needing that thats the way to go.
> What about creating a class that extends lets say htmlanchor and on the
> onclick event it passes something on the event args, or it has some
> properties that can be read/write?
Showing posts with label certain. Show all posts
Showing posts with label certain. Show all posts
Thursday, March 29, 2012
Saturday, March 24, 2012
passing variables from an aspx file to an ascx file...
I had a page that used includes, the include files used a variable which was set in the main page for certain functions...
check this thread...
I want to duplicate this using asp.net but haven't been able to successfully do it.
For clarity, I want to:
*define a variable in my aspx page
*call a user control in an ascx file
*inside the user control I want to see and use the variable set in the aspx file...
Help!!
Thanks in advance!
GeorgeI'm pretty sure if you create public global variables in your ascx file you can then set their value in the aspx file:
//In your .aspx fileMyUserControl.VariableA = "this and that";
check this thread...
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=332537
Subscribe to:
Posts (Atom)