Click here to Skip to main content
16,009,156 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Javascript Pin
Marc Soleda5-Aug-05 5:02
Marc Soleda5-Aug-05 5:02 
GeneralPrinting from PDF file in IE Pin
mv_coffee4-Aug-05 21:54
mv_coffee4-Aug-05 21:54 
GeneralEOF AND BOF ??? Error page with no result query Pin
evlxtc4-Aug-05 3:10
evlxtc4-Aug-05 3:10 
QuestionCancelling the META REFRESH timer Pin
Paul Watson4-Aug-05 2:18
sitebuilderPaul Watson4-Aug-05 2:18 
GeneralRe: Cancelling the META REFRESH timer Pin
Guffa4-Aug-05 4:32
Guffa4-Aug-05 4:32 
AnswerRe: Cancelling the META REFRESH timer Pin
Shog94-Aug-05 16:24
sitebuilderShog94-Aug-05 16:24 
GeneralRe: Cancelling the META REFRESH timer Pin
Paul Watson5-Aug-05 0:49
sitebuilderPaul Watson5-Aug-05 0:49 
Generalasp.net events Pin
wpcolleen4-Aug-05 0:16
wpcolleen4-Aug-05 0:16 
I am experiencing problems with events.

I want to develop (eventually) a keyboard pop-up window as a user control that will pass data back to the page.

I have attached a cut-down version and now basically all I have is a web form with a textbox, and a user control with a button on, which when pressed will populate the textbox with some characters.

I’m trying to use events to do this but I get errors, can any one help?

Webform1.asp.cs

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace testeventsc
{
///
/// Summary description for WebForm1.
///

public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
void uc1_OkClick(object source,EventArgs e)
{
this.TextBox1.Text = "xx";
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}

Webform1.aspx

<%@ Register TagPrefix="uc1" TagName="uc" Src="uc.ascx" %>
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="testeventsc.WebForm1" %>



<title>WebForm1








<asp:textbox id="TextBox1" runat="server">



<uc1:uc id="Uc1" runat="server">


 







uc.ascx.cs

namespace testeventsc
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

///
/// Summary description for uc1.
///

public delegate void OkClickEventHandler(object sender, EventArgs e);
public class uc1 : System.Web.UI.UserControl
{
public event OkClickEventHandler OkClick;
protected System.Web.UI.WebControls.Button buttonOK;


private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

public string Value()
{
return "xx";
}

private void buttonOK_Click(object sender, System.EventArgs e)
{
OkClick(this,new EventArgs());
}

}
}

<%@ Control Language="c#" AutoEventWireup="false" Codebehind="uc.ascx.cs" Inherits="testeventsc.uc1" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
            

<asp:button class="Fatkey" id="buttonOK" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 12px"
="" runat="server" text="Ok">


 


 


 


                                     






Clueless Novice
QuestionASP.NET &amp; System.Diagnostics.Debug.WriteLine ? Pin
Jon Hulatt3-Aug-05 23:22
Jon Hulatt3-Aug-05 23:22 
GeneralAsp SourceCode Management Tool Pin
Paul Sun3-Aug-05 21:28
Paul Sun3-Aug-05 21:28 
GeneralRe: Asp SourceCode Management Tool Pin
Paul Sun3-Aug-05 21:51
Paul Sun3-Aug-05 21:51 
GeneralRe: Asp SourceCode Management Tool Pin
enjoycrack3-Aug-05 23:53
enjoycrack3-Aug-05 23:53 
GeneralRe: Asp SourceCode Management Tool Pin
Paul Sun4-Aug-05 15:17
Paul Sun4-Aug-05 15:17 
GeneralASP.NET/C#/CDO COMException.. PLEASE HELP! Pin
Jonathan W. Zaleski3-Aug-05 11:22
Jonathan W. Zaleski3-Aug-05 11:22 
GeneralOn Closing a Browser Window... Pin
SABhatti3-Aug-05 4:05
SABhatti3-Aug-05 4:05 
GeneralRe: On Closing a Browser Window... Pin
Guffa3-Aug-05 5:34
Guffa3-Aug-05 5:34 
GeneralRe: On Closing a Browser Window... Pin
SABhatti3-Aug-05 6:29
SABhatti3-Aug-05 6:29 
GeneralUsing ActiveX component in a web page Pin
Spaz803-Aug-05 0:51
Spaz803-Aug-05 0:51 
GeneralRe: Using ActiveX component in a web page Pin
Pradyumna Gogte5-Aug-05 3:20
Pradyumna Gogte5-Aug-05 3:20 
GeneralNewbie Here Pin
Ethel038@aol.com2-Aug-05 19:56
Ethel038@aol.com2-Aug-05 19:56 
GeneralRe: Newbie Here Pin
Christian Graus2-Aug-05 20:06
protectorChristian Graus2-Aug-05 20:06 
GeneralRe: Newbie Here Pin
Vasudevan Deepak Kumar5-Aug-05 5:29
Vasudevan Deepak Kumar5-Aug-05 5:29 
GeneralJavascript &amp; Coldfusion Pin
walkerst2-Aug-05 17:56
walkerst2-Aug-05 17:56 
GeneralRe: Javascript &amp; Coldfusion Pin
Member 5569024-Aug-05 2:03
Member 5569024-Aug-05 2:03 
GeneralJavascript in ASP.net Pin
Dotnetdeveloper062-Aug-05 13:12
Dotnetdeveloper062-Aug-05 13:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.