I have done this many times but for some reason it's not working, the raise
postback event fires but the eventArgument passed to it is empty. This is a
simple custom control that implements
IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this,
tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at
public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
}
This has got to be another one of the many wier asp.net behaviors, any
ideas...Thanks... 11 1944
Did you assign the UniqueID to the name attribute of the custom Control?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl... I have done this many times but for some reason it's not working, the raise postback event fires but the eventArgument passed to it is empty. This is a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
Yes the unique id is set and RaisePostBackEvent is fired but eventArgument
passed to it is empty.
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl... Did you assign the UniqueID to the name attribute of the custom Control?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl...I have done this many times but for some reason it's not working, the
raise postback event fires but the eventArgument passed to it is empty. This
is a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
See Event Below:
public void RaisePostBackEvent(string eventArgument)
{
// this writes the correct value
this.Context.Trace.Write("eventArgument=" +
this.Page.Request["__EVENTARGUMENT"]);
// this does NOT write the correct value, it is empty
this.Context.Trace.Write("eventArgument=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
}
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl... Did you assign the UniqueID to the name attribute of the custom Control?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl...I have done this many times but for some reason it's not working, the
raise postback event fires but the eventArgument passed to it is empty. This
is a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
What does your LoadPostData method look like?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message
news:OI**************@TK2MSFTNGP09.phx.gbl... See Event Below:
public void RaisePostBackEvent(string eventArgument) { // this writes the correct value this.Context.Trace.Write("eventArgument=" + this.Page.Request["__EVENTARGUMENT"]);
// this does NOT write the correct value, it is empty this.Context.Trace.Write("eventArgument=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument); }
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:uP****************@TK2MSFTNGP09.phx.gbl... Did you assign the UniqueID to the name attribute of the custom Control?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl... >I have done this many times but for some reason it's not working, the raise > postback event fires but the eventArgument passed to it is empty. This is > a > simple custom control that implements > IPostBackEventHandler > > and I get the href for the a tag using > > string href = this.Page.GetPostBackClientHyperlink(this, > tab.TabID.ToString()); > > In the trace for the postback the argumts is listed but it never > arrives > at > > > > public void RaisePostBackEvent(string eventArgument) > > { > > this.Context.Trace.Write("SelectedID=" + eventArgument); > > this.SelectedID = Convert.ToInt32(eventArgument); > > } > > > > This has got to be another one of the many wier asp.net behaviors, any > ideas...Thanks... > >
I did read that you may need to implement IPostBackDataHandler, would sure
like to know why?
I did try it with the same results and the code is below:
public bool LoadPostData(String postDataKey, NameValueCollection values)
{
return false;
}
public void RaisePostDataChangedEvent()
{
}
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl... What does your LoadPostData method look like?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:OI**************@TK2MSFTNGP09.phx.gbl... See Event Below:
public void RaisePostBackEvent(string eventArgument) { // this writes the correct value this.Context.Trace.Write("eventArgument=" + this.Page.Request["__EVENTARGUMENT"]);
// this does NOT write the correct value, it is empty this.Context.Trace.Write("eventArgument=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument); }
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:uP****************@TK2MSFTNGP09.phx.gbl... Did you assign the UniqueID to the name attribute of the custom
Control? -- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl... >I have done this many times but for some reason it's not working, the raise > postback event fires but the eventArgument passed to it is empty.
This is > a > simple custom control that implements > IPostBackEventHandler > > and I get the href for the a tag using > > string href = this.Page.GetPostBackClientHyperlink(this, > tab.TabID.ToString()); > > In the trace for the postback the argumts is listed but it never > arrives > at > > > > public void RaisePostBackEvent(string eventArgument) > > { > > this.Context.Trace.Write("SelectedID=" + eventArgument); > > this.SelectedID = Convert.ToInt32(eventArgument); > > } > > > > This has got to be another one of the many wier asp.net behaviors,
any > ideas...Thanks... > >
Hi Mike,
The LoadPostData method is the one where you get the value from the
drop-down list box. You would then loop through your data source to figure
out the selected index.
I have an article/tutorial that does just that (using VB.Net as the
language). See: http://www.takempis.com/aspnet_anatomy3.asp
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl... I did read that you may need to implement IPostBackDataHandler, would sure like to know why?
I did try it with the same results and the code is below:
public bool LoadPostData(String postDataKey, NameValueCollection values) { return false; }
public void RaisePostDataChangedEvent() {
} "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:uC**************@TK2MSFTNGP10.phx.gbl... What does your LoadPostData method look like?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:OI**************@TK2MSFTNGP09.phx.gbl... > See Event Below: > > public void RaisePostBackEvent(string eventArgument) > { > // this writes the correct value > this.Context.Trace.Write("eventArgument=" + > this.Page.Request["__EVENTARGUMENT"]); > > // this does NOT write the correct value, it is empty > this.Context.Trace.Write("eventArgument=" + eventArgument); > > this.SelectedID = Convert.ToInt32(eventArgument); > } > > > "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message > news:uP****************@TK2MSFTNGP09.phx.gbl... >> Did you assign the UniqueID to the name attribute of the custom Control? >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> .Net Developer >> The sun never sets on >> the Kingdom of Heaven >> >> "Mike" <mi********@com.nospam> wrote in message >> news:uW**************@TK2MSFTNGP12.phx.gbl... >> >I have done this many times but for some reason it's not working, the > raise >> > postback event fires but the eventArgument passed to it is empty. This > is >> > a >> > simple custom control that implements >> > IPostBackEventHandler >> > >> > and I get the href for the a tag using >> > >> > string href = this.Page.GetPostBackClientHyperlink(this, >> > tab.TabID.ToString()); >> > >> > In the trace for the postback the argumts is listed but it never >> > arrives >> > at >> > >> > >> > >> > public void RaisePostBackEvent(string eventArgument) >> > >> > { >> > >> > this.Context.Trace.Write("SelectedID=" + eventArgument); >> > >> > this.SelectedID = Convert.ToInt32(eventArgument); >> > >> > } >> > >> > >> > >> > This has got to be another one of the many wier asp.net behaviors, any >> > ideas...Thanks... >> > >> > >> >> > >
Kevin,
This is a control that writes the html for a couple of links, no child
controls. I am simply using an anchor tag with
Page.GetPostBackClientHyperlink(this, linkID) as the href attribute when
rendering the control. linkID is just an internal ID so that the control can
tell wich link was clicked: 0,1,2,3 and so on...
The problem is that when RaisePostBackEvent is called the eventArgumet
parameter does not contain my internal ID that I pass with each link as
shown below. __EVENTARGUMENT is there just as it should be but dotnet never
hands it to my implementation of the RaisePostBackEvent. I can get it to
work if I just grab __EVENTARGUMENT from the Request object but that seems
like a rediculus hack.
public void RaisePostBackEvent(string eventArgument)
{
// this writes the correct value
this.Context.Trace.Write("eventArgument=" +
this.Page.Request["__EVENTARGUMENT"]);
// this does NOT write the correct value, it is empty
this.Context.Trace.Write("eventArgument=" + eventArgument);
}
Thanks,
Mike
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uv*************@TK2MSFTNGP15.phx.gbl... Hi Mike,
The LoadPostData method is the one where you get the value from the drop-down list box. You would then loop through your data source to figure out the selected index.
I have an article/tutorial that does just that (using VB.Net as the language). See:
http://www.takempis.com/aspnet_anatomy3.asp
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:eA**************@TK2MSFTNGP09.phx.gbl...I did read that you may need to implement IPostBackDataHandler, would
sure like to know why?
I did try it with the same results and the code is below:
public bool LoadPostData(String postDataKey, NameValueCollection values) { return false; }
public void RaisePostDataChangedEvent() {
} "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:uC**************@TK2MSFTNGP10.phx.gbl... What does your LoadPostData method look like?
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:OI**************@TK2MSFTNGP09.phx.gbl... > See Event Below: > > public void RaisePostBackEvent(string eventArgument) > { > // this writes the correct value > this.Context.Trace.Write("eventArgument=" + > this.Page.Request["__EVENTARGUMENT"]); > > // this does NOT write the correct value, it is empty > this.Context.Trace.Write("eventArgument=" + eventArgument); > > this.SelectedID = Convert.ToInt32(eventArgument); > } > > > "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message > news:uP****************@TK2MSFTNGP09.phx.gbl... >> Did you assign the UniqueID to the name attribute of the custom Control? >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> .Net Developer >> The sun never sets on >> the Kingdom of Heaven >> >> "Mike" <mi********@com.nospam> wrote in message >> news:uW**************@TK2MSFTNGP12.phx.gbl... >> >I have done this many times but for some reason it's not working,
the > raise >> > postback event fires but the eventArgument passed to it is empty. This > is >> > a >> > simple custom control that implements >> > IPostBackEventHandler >> > >> > and I get the href for the a tag using >> > >> > string href = this.Page.GetPostBackClientHyperlink(this, >> > tab.TabID.ToString()); >> > >> > In the trace for the postback the argumts is listed but it never >> > arrives >> > at >> > >> > >> > >> > public void RaisePostBackEvent(string eventArgument) >> > >> > { >> > >> > this.Context.Trace.Write("SelectedID=" + eventArgument); >> > >> > this.SelectedID = Convert.ToInt32(eventArgument); >> > >> > } >> > >> > >> > >> > This has got to be another one of the many wier asp.net behaviors, any >> > ideas...Thanks... >> > >> > >> >> > >
PROBLEM SOLVED!!!!!
I did a project wide search for RegisterRequiresRaiseEvent and found
Page.RegisterRequiresRaiseEvent(this) was being called in another control on
the page. This completely breaks all other events on the page.
Spent two days trying to figure this out so maybe this helps someone else.
I know exactly why this caused a problem but this is just one more example
of one of those wierd things that dotnet does that drives me crazy.
Mike
"Mike" <mi********@com.nospam> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl... I have done this many times but for some reason it's not working, the
raise postback event fires but the eventArgument passed to it is empty. This is
a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives
at
public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
Glad you got it solved Mike, as I was away over the weekend!
--
Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message
news:eZ**************@TK2MSFTNGP14.phx.gbl... PROBLEM SOLVED!!!!!
I did a project wide search for RegisterRequiresRaiseEvent and found Page.RegisterRequiresRaiseEvent(this) was being called in another control on the page. This completely breaks all other events on the page.
Spent two days trying to figure this out so maybe this helps someone else.
I know exactly why this caused a problem but this is just one more example of one of those wierd things that dotnet does that drives me crazy.
Mike
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl... I have done this many times but for some reason it's not working, the raise postback event fires but the eventArgument passed to it is empty. This is a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at
public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
"Kevin Spencer" wrote: Glad you got it solved Mike, as I was away over the weekend!
--
Kevin Spencer Microsoft MVP ..Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:eZ**************@TK2MSFTNGP14.phx.gbl... PROBLEM SOLVED!!!!!
I did a project wide search for RegisterRequiresRaiseEvent and found Page.RegisterRequiresRaiseEvent(this) was being called in another control on the page. This completely breaks all other events on the page.
Spent two days trying to figure this out so maybe this helps someone else.
I know exactly why this caused a problem but this is just one more example of one of those wierd things that dotnet does that drives me crazy.
Mike
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl... I have done this many times but for some reason it's not working, the raise postback event fires but the eventArgument passed to it is empty. This is a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at
public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
I wonder if the Page.RegisterRequiresRaiseEvent and Page.RequiresPostBack are
asp.net bugs,for they are somewhat "ugly" and difficult to use.At the same
time, I wonder if there is other alternatives I can choose.I've read the book
"Developing Microsoft ASP.NET Server Controls and Components" by Nikhil
Kothari, and here is some codes in LoadPostData method in code list 9-11:
bool buttonClicked = (buttonValue != null) && (buttonValue.Length != 0);
if (buttonClicked) Page.RegisterRequiresRaiseEvent(this);
Reading these codes,I feel I go back to the asp times again. these are
somewhat ugly.
"Kevin Spencer" wrote: Glad you got it solved Mike, as I was away over the weekend!
--
Kevin Spencer Microsoft MVP ..Net Developer The sun never sets on the Kingdom of Heaven
"Mike" <mi********@com.nospam> wrote in message news:eZ**************@TK2MSFTNGP14.phx.gbl... PROBLEM SOLVED!!!!!
I did a project wide search for RegisterRequiresRaiseEvent and found Page.RegisterRequiresRaiseEvent(this) was being called in another control on the page. This completely breaks all other events on the page.
Spent two days trying to figure this out so maybe this helps someone else.
I know exactly why this caused a problem but this is just one more example of one of those wierd things that dotnet does that drives me crazy.
Mike
"Mike" <mi********@com.nospam> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl... I have done this many times but for some reason it's not working, the raise postback event fires but the eventArgument passed to it is empty. This is a simple custom control that implements IPostBackEventHandler
and I get the href for the a tag using
string href = this.Page.GetPostBackClientHyperlink(this, tab.TabID.ToString());
In the trace for the postback the argumts is listed but it never arrives at
public void RaisePostBackEvent(string eventArgument)
{
this.Context.Trace.Write("SelectedID=" + eventArgument);
this.SelectedID = Convert.ToInt32(eventArgument);
} This has got to be another one of the many wier asp.net behaviors, any ideas...Thanks...
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Pavils Jurjans |
last post by:
Hallo,
I have been programming for restricted environments where Internet Explorer
is a standard, so I haven't stumbled upon this problem until now, when I
need to write a DOM-compatible code.
...
|
by: domeceo |
last post by:
can anyone tell me why I cannot pass values in a setTimeout function
whenever I use this function it says "menu is undefined" after th
alert.
function imgOff(menu, num) {
if (document.images) {...
|
by: shihabca |
last post by:
How to determine the keycode in a netscape browser , so that i can allow only numbers to be entered into the textbox. this has to be done without passing any event as argument
|
by: Klom Dark |
last post by:
I'm trying to figure out how to get a table of dynamically created buttons to actually call the command associated with it. It never seems to work, but doing more research it looks like I may need to...
|
by: Mr Newbie |
last post by:
I still have a few questions here. Ive been following some examples in a
Microsoft Press book on this and have produced a small calculator control
which I have written most of the code for.
My...
|
by: Max |
last post by:
Last time I tried to explain this on another forum it didn't go too
well, so I'll try my best and if you know what I'm talking about then
please tell me how to do this.
I have a class, inside I...
|
by: Kerry Jenkins |
last post by:
I am having problems passing an Event Delegate as an argument to a
method that accepts a delegate argument. I get the following error
message:
'Public Event ProgressChanged(sender As Object, e...
|
by: diffuser78 |
last post by:
I wrote a small app in wxPython using wxGlade as designer tool. wxGlade
brings and writes a lot of code by itself and thats where my confusion
started. Its about parameter passing. Here is my...
|
by: Janus |
last post by:
Hi,
Is there a way to pass arguments to the callback function used inside
an addEventListener?
I see that I can only list the name of the callback function.
For eg, I use this:
var...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |