Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Jon Paal #1
post back event in server control
how do I get the button event recognized in the post back from a server control ??
========code=============
Public Class MyButton
Inherits System.Web.UI.Page
Implements IPostBackEventHandler
Public Response As HttpResponse = HttpContext.Current.Response
' Defines the Click event.
'-----------------------------
Public Event Click As EventHandler
' OnClick dispatches the event to delegates that
' are registered with the Click event.
' Controls that derive from MyButton can handle the
' Click event by overriding OnClick
' instead of attaching a delegate. The event data
' is passed as an argument to this method.
'-----------------------------------------------
Protected Overridable Sub OnClick(e As EventArgs)
RaiseEvent Click(Me, e)
End Sub
' Method of IPostBackEventHandler that raises change events.
'-----------------------------------------------------------
Public Sub RaisePostBackEvent(eventArgument As String)
Implements PostBackEventHandler.RaisePostBackEvent
OnClick(EventArgs.Empty)
System.Web.UI.Page.ClientScript.RegisterStartupScr ipt(Me.GetType(), "MyScript", _
"function AlertHello() { alert('Hello'); }", True)
End Sub 'RaisePostBackEvent
Public Sub New()
Response.Write("<INPUT TYPE = submit name = " & Me.UniqueID & " Value = 'Click Me' />")
End Sub
End Class
Jon Paal Guest
-
Flash Player Post Back data to server
Hello, I have a flash based application that I am having a data transfer issue with. 1 particular user can access the flash application which... -
2nd attempt - post back event in server control
my code is not getting successful result. how do I get the server control to recognize a button click event ?? ========code============= ... -
Dragging rows without a post back to the server.
I have been able to create a datagrid that is able to click and drag from one row and drop it onto another to move it above the row dropped on. The... -
How to Capture Control Initaited the Post Back.
Here is my problem, I am using 3 user controls in a page(Test.aspx) which are 1.Header UC 2.Body UC 3.Footer UC HeaderUC has a DropDownList... -
Post back and control focus issues
Hi, This might help : http://www.developer.com/net/asp/article.php/2237431 Natty Gur, CTO Dao2Com Ltd. 28th Baruch Hirsch st. Bnei-Brak... -
Gaurav Vaish \(www.EduJiniOnline.com\) #2
Re: post back event in server control
> how do I get the button event recognized in the post back from a server
Don't use 'Response.Write'.> control ??
But use:
override CreateChildControls()
{
base.CreateChildControls();
Button btn = new Button;
btn.Text = ...
btn.Value = ...
Controls.Add(btn);
}
--
Happy Hacking,
Gaurav Vaish | [url]http://www.mastergaurav.com[/url]
[url]http://www.edujinionline.com[/url]
[url]http://articles.edujinionline.com/webservices[/url]
-------------------
Gaurav Vaish \(www.EduJiniOnline.com\) Guest



Reply With Quote

