Click here to Skip to main content
15,887,083 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionNeed a regular expression validation Pin
meeram39531-May-10 21:28
meeram39531-May-10 21:28 
AnswerRe: Need a regular expression validation Pin
Eduard Keilholz31-May-10 21:43
Eduard Keilholz31-May-10 21:43 
GeneralRe: Need a regular expression validation Pin
meeram39531-May-10 22:31
meeram39531-May-10 22:31 
GeneralRe: Need a regular expression validation Pin
meeram39531-May-10 23:37
meeram39531-May-10 23:37 
AnswerRe: Need a regular expression validation Pin
Ankur\m/1-Jun-10 0:23
professionalAnkur\m/1-Jun-10 0:23 
GeneralRe: Need a regular expression validation Pin
meeram3951-Jun-10 0:46
meeram3951-Jun-10 0:46 
AnswerRe: Need a regular expression validation Pin
Sandeep Mewara1-Jun-10 0:00
mveSandeep Mewara1-Jun-10 0:00 
QuestionReturn List<> on button click of user control. Pin
zeego31-May-10 21:21
zeego31-May-10 21:21 
Hi I want to return a list of records on button click of user control.
I already have the collection ready , but I dont know how to return the collection to the calling page.
How do I bind results of user control with gridview on parent page on user control button click ?


My user control code
public partial class assets_WebControls_ftExclusions : System.Web.UI.UserControl
{
    private int _id;
    private ftExclusionsList myftExclusions;

    public int ID
    {
        get{return _id;}
        set{_id=value;}
    }

    public ftExclusionsList selectedExclusions
    {
        get { return myftExclusions; }
        set { myftExclusions = value; }
    }
   
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            cblExclusions.DataBind();
            ftExclusionsList myExcluList = ftExclusionsManager.ftExclusionsById(ID);
            if (myExcluList != null)
            {
                if (myExcluList.Count &gt; 0 &amp;&amp; myExcluList != null)
                {
                    foreach (ftExclusions ex in myExcluList)
                    {
                        cblExclusions.Items.FindByValue(ex.excluId.ToString()).Selected = true;
                    }
                }
            }
        }
        
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        ftExclusionsList myFTExclusionList = new ftExclusionsList();
        foreach (ListItem li in cblExclusions.Items)
        {
            if (li.Selected == true)
            {
                ftExclusions myftExclusion = new ftExclusions();
                myftExclusion.excluId = Convert.ToInt32(li.Value);
                myftExclusion.excludesc = li.Text.ToString();
                myFTExclusionList.Add(myftExclusion);
            }
            
        }
        selectedExclusions = myFTExclusionList;
// how do I return this list and bind it with gridview on calling page?
    }
}

AnswerRe: Return List on button click of user control. Pin
Brij31-May-10 21:34
mentorBrij31-May-10 21:34 
GeneralRe: Return List on button click of user control. Pin
zeego31-May-10 21:49
zeego31-May-10 21:49 
GeneralRe: Return List on button click of user control. Pin
michaelschmitt31-May-10 22:45
michaelschmitt31-May-10 22:45 
GeneralRe: Return List on button click of user control. Pin
zeego31-May-10 23:06
zeego31-May-10 23:06 
GeneralRe: Return List on button click of user control. Pin
michaelschmitt1-Jun-10 0:27
michaelschmitt1-Jun-10 0:27 
GeneralRe: Return List on button click of user control Pin
zeego1-Jun-10 1:19
zeego1-Jun-10 1:19 
GeneralRe: Return List on button click of user control Pin
michaelschmitt1-Jun-10 2:30
michaelschmitt1-Jun-10 2:30 
AnswerRe: Return List on button click of user control. Pin
Andreas X1-Jun-10 1:28
professionalAndreas X1-Jun-10 1:28 
Questiontext in windows service appears to have old reference Pin
Member 391904931-May-10 21:16
Member 391904931-May-10 21:16 
AnswerRe: text in windows service appears to have old reference Pin
Sandeep Mewara31-May-10 23:56
mveSandeep Mewara31-May-10 23:56 
GeneralRe: text in windows service appears to have old reference Pin
Member 39190491-Jun-10 5:53
Member 39190491-Jun-10 5:53 
AnswerRe: text in windows service appears to have old reference Pin
aashish.saalvi1-Jun-10 1:53
aashish.saalvi1-Jun-10 1:53 
QuestionDataView Pin
Satish_S31-May-10 20:58
Satish_S31-May-10 20:58 
AnswerRe: DataView Pin
Sandeep Mewara31-May-10 23:58
mveSandeep Mewara31-May-10 23:58 
Questiontrying to get windows service to auto-start after install Pin
Member 391904931-May-10 19:25
Member 391904931-May-10 19:25 
AnswerRe: trying to get windows service to auto-start after install Pin
Sandeep Mewara31-May-10 19:44
mveSandeep Mewara31-May-10 19:44 
Questionasp table with javascript getelementbyid Pin
Aljaz11131-May-10 14:53
Aljaz11131-May-10 14:53 

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.