Click here to Skip to main content
15,903,175 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: usercontrol event Pin
Not Active17-May-10 18:00
mentorNot Active17-May-10 18:00 
GeneralRe: usercontrol event Pin
PunkIsNotDead18-May-10 11:05
PunkIsNotDead18-May-10 11:05 
GeneralRe: usercontrol event Pin
Dhyanga18-May-10 2:31
Dhyanga18-May-10 2:31 
GeneralRe: usercontrol event Pin
Dhyanga18-May-10 2:43
Dhyanga18-May-10 2:43 
GeneralRe: usercontrol event Pin
PunkIsNotDead18-May-10 17:34
PunkIsNotDead18-May-10 17:34 
GeneralRe: usercontrol event Pin
Dhyanga19-May-10 3:23
Dhyanga19-May-10 3:23 
GeneralRe: usercontrol event [modified] Pin
PunkIsNotDead19-May-10 10:19
PunkIsNotDead19-May-10 10:19 
GeneralRe: usercontrol event Pin
Dhyanga20-May-10 5:09
Dhyanga20-May-10 5:09 
hey i still couldn't get out of it. Let me put down what all i did.

I have one button and a textbox in usercontrol1.ascx page.

the code inside this page is shown as:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Globalization;
using System.Text;


namespace ProjectRequestTest
{
public delegate void ResponseEventHandler(object sender, ResponseEventArgs d);
public partial class usercontrol1 : System.Web.UI.UserControl
{
public event ResponseEventHandler ResultOfMyText;

protected void Page_Load(object sender, EventArgs e)
{

}
[Description("Event that fires after button click of user control")]
protected virtual void OnResult_Show(ResponseEventArgs re)
{
if (ResultOfMyText != null)
ResultOfMyText(this, re);
}

protected void Button1_Click(object sender, EventArgs e)
{
ResponseEventArgs re = new ResponseEventArgs();
re.MyValue = TextBox1.Text;//You need a textbox named Txt_ValueOnResult_Show(re);
OnResult_Show(re);
}
}
}


now the ResponseEventArgs.cs class has code like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectRequestTest
{
public class ResponseEventArgs : EventArgs
{
private String _myValue;
public String MyValue
{
get
{
return _myValue;
}
set
{
_myValue = value;
}
}
}
}


now for usercontrol.aspx page, i have one textbox and that usercontrol from ascx page. the code behind in this page is :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectRequestTest
{
public partial class usercontrol : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void ResultOfMyText(object sender, ResponseEventArgs d)
{
TextBox1.Text = d.MyValue;

}
}
}

but when i click the button, the textbox of aspx page is still not showing the value ??

What could have gone wrong ???
suchita

GeneralRe: usercontrol event Pin
PunkIsNotDead20-May-10 18:18
PunkIsNotDead20-May-10 18:18 
GeneralRe: usercontrol event Pin
Dhyanga24-May-10 3:13
Dhyanga24-May-10 3:13 
GeneralRe: usercontrol event Pin
PunkIsNotDead24-May-10 16:48
PunkIsNotDead24-May-10 16:48 
QuestionTabbed Excel Pin
Civic0617-May-10 5:58
Civic0617-May-10 5:58 
Questionstop Page scrolling upwards [modified] Pin
Enobong Adahada17-May-10 3:49
Enobong Adahada17-May-10 3:49 
AnswerRe: stop Page scrolling upwards Pin
dan!sh 17-May-10 5:22
professional dan!sh 17-May-10 5:22 
AnswerRe: stop Page scrolling upwards Pin
Rutvik Dave17-May-10 5:24
professionalRutvik Dave17-May-10 5:24 
GeneralRe: stop Page scrolling upwards Pin
DeepToot18-May-10 8:31
DeepToot18-May-10 8:31 
QuestionCannot find either column "dbo" or the user-defined function or aggregate "dbo.getname", or the name is ambiguous. Pin
sankararao17-May-10 3:24
sankararao17-May-10 3:24 
AnswerRe: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.getname", or the name is ambiguous. Pin
Not Active17-May-10 3:39
mentorNot Active17-May-10 3:39 
AnswerRe: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.getname", or the name is ambiguous. Pin
Peace ON17-May-10 3:47
Peace ON17-May-10 3:47 
GeneralRe: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.getname", or the name is ambiguous. Pin
sankararao17-May-10 3:53
sankararao17-May-10 3:53 
GeneralRe: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.getname", or the name is ambiguous. Pin
Peace ON17-May-10 3:59
Peace ON17-May-10 3:59 
QuestionHow to return Designer View for aspx page? Pin
Chesnokov Yuriy17-May-10 3:14
professionalChesnokov Yuriy17-May-10 3:14 
AnswerRe: How to return Designer View for aspx page? Pin
TheyCallMeMrJames17-May-10 6:09
TheyCallMeMrJames17-May-10 6:09 
GeneralRe: How to return Designer View for aspx page? Pin
Chesnokov Yuriy17-May-10 6:36
professionalChesnokov Yuriy17-May-10 6:36 
Questionweb application and .netframework temporary error Pin
Zeyad Jalil17-May-10 3:00
professionalZeyad Jalil17-May-10 3:00 

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.