Click here to Skip to main content
16,006,341 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Receipt Log [modified] Pin
Cory Hatton6-Jun-07 2:59
Cory Hatton6-Jun-07 2:59 
GeneralRe: Receipt Log Pin
Not Active6-Jun-07 5:16
mentorNot Active6-Jun-07 5:16 
GeneralRe: Receipt Log Pin
Cory Hatton6-Jun-07 6:21
Cory Hatton6-Jun-07 6:21 
QuestionGetting Web Application's Virtual Path from Server Control Pin
Nadia Monalisa5-Jun-07 5:54
Nadia Monalisa5-Jun-07 5:54 
QuestionValidation Pin
Rahul Babu5-Jun-07 3:52
Rahul Babu5-Jun-07 3:52 
AnswerRe: Validation Pin
Not Active5-Jun-07 5:04
mentorNot Active5-Jun-07 5:04 
QuestionHow to handle onselectindexchanged method in UserControl(.ascx page) Pin
ramyasangeet5-Jun-07 3:47
ramyasangeet5-Jun-07 3:47 
AnswerRe: How to handle onselectindexchanged method in UserControl(.ascx page) Pin
Mariusz Wojcik5-Jun-07 4:24
Mariusz Wojcik5-Jun-07 4:24 
To do that you must first declare in your "hosting" aspx page a procedure which will handle an event:

public void RadioButtonIndexChangedProc(object sender, System.EventArgs e)<br />
{<br />
  RadioButtonList rbl = (RadioButtonList) sender;<br />
  // do what you need with data.<br />
}


Next in the user control, in the SelectedIndexChange event call that procedure:

private void RadioButtonList1_SelectedIndexChanged(object sender, System.EventArgs e)<br />
{<br />
  // get e reference to page object<br />
  WebForm1 page = (WebForm1) Page;<br />
  // call method handling Index changing<br />
  page.RadioButtonIndexChangedProc(sender, e);<br />
}


As you can see, you can access your hosting aspx page by using Page object, and by casting it to appropriate type (class of your hosting page, in my case WebForm1) you have access to all public class members.

In case of reusing an usercontrol on diffrent web pages think about implementing one base class or implementing an Interface which will handle RadioButtonIndexChange by every class which uses your usercontrol.

--
Mariusz 'mAv' Wójcik
master e-software engineer

GeneralRe: Example using Interface Pin
Mariusz Wojcik5-Jun-07 4:47
Mariusz Wojcik5-Jun-07 4:47 
GeneralRe: How to handle onselectindexchanged method in UserControl(.ascx page) Pin
Not Active5-Jun-07 5:07
mentorNot Active5-Jun-07 5:07 
AnswerRe: How to handle onselectindexchanged method in UserControl(.ascx page) Pin
Not Active5-Jun-07 5:14
mentorNot Active5-Jun-07 5:14 
QuestionPrint button in crystal report..., Pin
Member 38798815-Jun-07 3:04
Member 38798815-Jun-07 3:04 
Questionmaster detail Pin
kvijayajyothy5-Jun-07 3:03
kvijayajyothy5-Jun-07 3:03 
AnswerRe: master detail Pin
Not Active5-Jun-07 3:43
mentorNot Active5-Jun-07 3:43 
AnswerRe: master detail Pin
badgrs5-Jun-07 22:22
badgrs5-Jun-07 22:22 
Questioncookies : how to write page_load to cookies Pin
kinsella_john5-Jun-07 1:43
kinsella_john5-Jun-07 1:43 
AnswerRe: cookies : how to write page_load to cookies Pin
Mariusz Wojcik5-Jun-07 2:05
Mariusz Wojcik5-Jun-07 2:05 
QuestionValidation to accept only numbers!!! Pin
rameshbhojan5-Jun-07 1:30
rameshbhojan5-Jun-07 1:30 
AnswerRe: Validation to accept only numbers!!! Pin
Mariusz Wojcik5-Jun-07 1:56
Mariusz Wojcik5-Jun-07 1:56 
AnswerRe: Validation to accept only numbers!!! Pin
Nouman Bhatti5-Jun-07 2:14
Nouman Bhatti5-Jun-07 2:14 
AnswerRe: Validation to accept only numbers!!! Pin
koolprasad20035-Jun-07 2:16
professionalkoolprasad20035-Jun-07 2:16 
GeneralRe: Validation to accept only numbers!!! Pin
DavidNohejl5-Jun-07 4:23
DavidNohejl5-Jun-07 4:23 
AnswerRe: Validation to accept only numbers!!! Pin
Rahul Babu5-Jun-07 3:42
Rahul Babu5-Jun-07 3:42 
Questionneed help with adding an all option to the data grid parameter. Pin
neodeaths5-Jun-07 1:09
neodeaths5-Jun-07 1:09 
Questionhow to display, modify MS Excel sheet in ASPX page using .NET 1.1 with C# Pin
rajnish_haldiya5-Jun-07 0:03
rajnish_haldiya5-Jun-07 0:03 

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.