Ask a Question related to ASP.NET General, Design and Development.
-
Lloyd Dupont #1
handling event in server control
I am developing a special control, in fact it's a <td> tag
however on click I need to submit somedata.
so I write
protected void Render(HtmlTextWriter htw)
{
// ......
htw.Write("<td name='{0}' onclick='javascript:submit()'", UniqueID);
// ..
}
and implement IPostBackEventHandler.
however the method RaisePostBackEvent is never called (although the page is
reload), any ideas ?
Lloyd Dupont Guest
-
Handling a click event in custom server control
I'm using VS 2005. I created a sample composite control with a textbox and a button. I'm having problems getting the button event. The control... -
Exception handling in server control development
Dear Folks, in the server control development, i am throwing exception from the server control. i know that this cannot be handled in the page_load... -
Event handling in a Custom Tree control in ASP.Net and C3 web application
I have a Tree control for displaying folders list for aparticular client in a Tree structure in a web application usingAsp.NET and C#. Now i want to... -
Adding dynamically user control (ASCX) into asp.net page and handling OnClick event
Hi, I've been reading a lot's of Q&A on user controls but none seem to answer my question. Here it is. I need to add dynamically a user control,... -
Custom server Controls event handling (Parent/Child)
Hi, Hello, I have a question regarding Custom server Controls event handling. The problem I am facing is, I have created 2 Controls say... -
Natty Gur #2
Re: handling event in server control
Yep
The doPostback should contain the ID of the control as the first
parameter. ASP.NET uses it to know which control to call. The second
parameter usually used if more than one event exists.
oSTR.Append(" onchange=\"__doPostBack('"+ this.ID +"','change')\"
language=\"javascript\" \n");
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
William F. Robertson, Jr. #3
Re: handling event in server control
1. There is no value posted back for a td tag.
2. Rather than just straight submitting the form, you might want to look
into GetPostBackClientEvent method.
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url]
frlrfsystemwebuipageclassgetpostbackclienteventtop ic.asp
protected override void Render( HtmlTextWriter writer )
{
writer.AddAttribute( HtmlTextWriterAttribute.Name, UniqueID );
writer.AddAttribute( HtmlTextWriterAttribute.OnClick,
Page.GetClientPostBackEvent( this, "event args passed to your
RaisePostBackEvent" );
writer.RenderBeginTag( HtmlTextWriterTag.Td );
writer.RenderEndTag();
}
You really should use the "helper" function provided by the page to handle
the postback. By just calling submit, the form is just submitted, it
doesn't know what button ( any other control) triggered the post back.
HTH,
bill
"Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> wrote in message
news:#hjTvKRVDHA.1832@TK2MSFTNGP09.phx.gbl...is> I am developing a special control, in fact it's a <td> tag
> however on click I need to submit somedata.
> so I write
>
> protected void Render(HtmlTextWriter htw)
> {
> // ......
> htw.Write("<td name='{0}' onclick='javascript:submit()'", UniqueID);
> // ..
> }
> and implement IPostBackEventHandler.
> however the method RaisePostBackEvent is never called (although the page> reload), any ideas ?
>
>
William F. Robertson, Jr. Guest
-
Lloyd Dupont #4
Re: handling event in server control
I agree you, I was just looking for the information !
You gave me the exactly accurate and useful answer !
thansk the tip mate,
Lloyd
"William F. Robertson, Jr." <wfrobertson@kpmg.com> a écrit dans le message
de news:eh3Hg3RVDHA.2340@TK2MSFTNGP10.phx.gbl...[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url]> 1. There is no value posted back for a td tag.
> 2. Rather than just straight submitting the form, you might want to look
> into GetPostBackClientEvent method.
>
>> frlrfsystemwebuipageclassgetpostbackclienteventtop ic.asp
>
> protected override void Render( HtmlTextWriter writer )
> {
> writer.AddAttribute( HtmlTextWriterAttribute.Name, UniqueID );
> writer.AddAttribute( HtmlTextWriterAttribute.OnClick,
> Page.GetClientPostBackEvent( this, "event args passed to your
> RaisePostBackEvent" );
> writer.RenderBeginTag( HtmlTextWriterTag.Td );
> writer.RenderEndTag();
> }
>
> You really should use the "helper" function provided by the page to handle
> the postback. By just calling submit, the form is just submitted, it
> doesn't know what button ( any other control) triggered the post back.
>
> HTH,
>
> bill
>
> "Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> wrote in message
> news:#hjTvKRVDHA.1832@TK2MSFTNGP09.phx.gbl...> is> > I am developing a special control, in fact it's a <td> tag
> > however on click I need to submit somedata.
> > so I write
> >
> > protected void Render(HtmlTextWriter htw)
> > {
> > // ......
> > htw.Write("<td name='{0}' onclick='javascript:submit()'", UniqueID);
> > // ..
> > }
> > and implement IPostBackEventHandler.
> > however the method RaisePostBackEvent is never called (although the page>> > reload), any ideas ?
> >
> >
>
Lloyd Dupont Guest



Reply With Quote

