Question

I am a desktop client developer. I now got to continue this project is ASP.NET with AJAX, so I am learning web development the hard way.

I need to get a list of all check boxes and their states from repeater control on Summary.aspx when user clicks button CmdSave on ChoicePage.aspx.

Can I subscribe to event CmdSave_Click() in Summary.aspx or is there some way to approach Summary.aspx's repeater control from ChoicePage.aspx?

(MSDN talks about passing values from page to page in this article but this doesn't help me)

Here is the problem: Page ChoicePage.aspx is included in Master AppMaster.master page. ChoicePage has Content tag which includes CmdSave and it's event handler CmdSave_Click() and it also includes iframe tag for displaying another page, Summary.aspx

On Summary.aspx I have repeater control which is bound to DataSource and relevant fields are of type bool represented by column of editable check boxes. Clicking these checkboxes mustn't cause Summary.aspx to refresh so I am not looking to handle (server-side) CheckedChanged event.

I am not sure if any code example would help here since this is more a concept question

function SetFrameStatus() {
        var v = hdCommand.value.toString().toLowerCase();
        hdCommand.value = "";

        var frms = (GetFrameAll("FrameSummary"));
        if (frms)
        { }
        else return;
        FrameSummary = frms[0];
        DivSummary = FrameSummary.parentNode;
        var FrameWindow = frms[1];
        var FrameDocument = frms[2];
        if (v == "showsummary") {
            FrameWindow.location.replace(SummaryPageName);
        }
 }

<asp:Content ID="ContentSummary" ContentPlaceHolderID="NoUpdateDiv" runat="server">
    <div id="DivMenu" class="Flat" style="overflow:visible; display:none;position:absolute;">
        <input type="button" id="CmdSave" value="Save" onclick="CmdSave_Click()" />
    </div>    
    <div id="DivSummary" style="position:absolute;margin:0px;padding:0px;display:none">
    <iframe title="Loading" id="FrameSummary" marginheight="0px" marginwidth="0px" scrolling="auto"
        style="padding:0px; margin:0px;width:auto;" src="loading.htm?Redirect=Summary.aspx" frameborder="0" 
        onload="FrameSummary_Load()"
    ></iframe>
</div>
Was it helpful?

Solution

In the end this is what solved my problem:

On ChoicePage.aspx in CmdSave_Click() function I called another function on Summary.aspx.

This other function did __dopostback("Repeater", "") and on Render event in my code behind I iterate through a Repeater.

I am leaving this question unanswered because I am sure there is a better way to do this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top