Click here to Skip to main content
15,900,108 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Help me to Learn ASP.NET Pin
Dr.Walt Fair, PE22-Jun-10 10:39
professionalDr.Walt Fair, PE22-Jun-10 10:39 
QuestionPassing Parameters to a Stored Procedure (in C# NOT VB) Pin
DRAYKKO22-Jun-10 7:57
professionalDRAYKKO22-Jun-10 7:57 
AnswerRe: Passing Parameters to a Stored Procedure (in C# NOT VB) [modified] Pin
Not Active22-Jun-10 8:20
mentorNot Active22-Jun-10 8:20 
GeneralRe: Passing Parameters to a Stored Procedure (in C# NOT VB) Pin
DRAYKKO22-Jun-10 8:28
professionalDRAYKKO22-Jun-10 8:28 
AnswerRe: Passing Parameters to a Stored Procedure (in C# NOT VB) Pin
Adam R Harris22-Jun-10 11:13
Adam R Harris22-Jun-10 11:13 
QuestionTab control within Tab Control Pin
indian14322-Jun-10 7:46
indian14322-Jun-10 7:46 
AnswerRe: Tab control within Tab Control Pin
Sandeep Mewara22-Jun-10 11:16
mveSandeep Mewara22-Jun-10 11:16 
QuestionUpdatePanel prevents javascript from getting latest value from a control Pin
Adam Brown 322-Jun-10 7:29
Adam Brown 322-Jun-10 7:29 
I have some code that works correctly until I utilize a dynamic UpdatePanel to reduce flicker. I am trying to get a value from the parent page via javascript. This code works correctly without the UpdatePanel to get the current value of the hidden field. Once I add the UpdatePanel dynamically, it only ever returns the initial value of 0 from the hidden field. Any ideas?

Javascript in popup page (returns only iniital value of zero if I use UpdatePanel):
var x = window.parent.document.getElementById('ctl00$contentBody$hdnApplicationIndex').value

Parent page (the one that uses ModalPopupExtender to display popup):
<asp:HiddenField ID="hdnApplicationIndex" Value="0" runat="server" />
<asp:Button ID="btnHidden" runat="server" style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="mpeUser" runat="server"
    CancelControlID="btnCancel"
    OkControlID="btnOK"
    TargetControlID="btnHidden"
    PopupControlID="pnlUser"
    PopupDragHandleControlID="pnlPopupHeader"
    BackgroundCssClass="ModalPopup">
</ajaxToolkit:ModalPopupExtender>
<div id="pnlUser" style="display: none;height:600px;width:800px">
    <asp:Panel runat="Server" ID="pnlPopupHeader" CssClass="PopupHeader">
        User Search
    </asp:Panel>
    <iframe id="frmUserSearch" src="ModelUserSearch.aspx" scrolling="yes" style="height:100%;width:100%" frameborder="1">
    </iframe>
    <div style="display: none">
        <input id="btnOK" onclick="ok();" type="button" value="OK" />
        <input id="btnCancel" type="button" value="Cancel" />
    </div>
</div>


Code-behind of parent page (happens during OnInit):
Button btnModelUser = new Button();
btnModelUser.ID = "btnModelUser_" + intAppIndex;
btnModelUser.Text = "Model User...";
btnModelUser.Click += new EventHandler(btnModelUser_Click);

UpdatePanel updModelUser = new UpdatePanel();
updModelUser.ID = "updModelUser_" + intAppIndex;
updModelUser.ContentTemplateContainer.Controls.Add(btnModelUser);

Table tblQuestions = new Table();
tblQuestions.ID = "tblQuestions_" + intAppIndex;

TableRow trModelUser = new TableRow();
trModelUser.ID = "trModelUser_" + intAppIndex;

TableCell tcModelUserButton = new TableCell();
tcModelUserButton.ID = "tcModelUserButton_" + intAppIndex;
tcModelUserButton.Controls.Add(updModelUser);

Here is where I change the value of the hidden field. Updated value is not retreived when I use the UpdatePanel:
protected void btnModelUser_Click(object sender, EventArgs e)
{
    Button button = sender as Button;
    int intIndexUnderscore = button.ID.IndexOf("_");

    //Save index of applicaiton panel so popup knows where to update results
    hdnApplicationIndex.Value  = button.ID.Substring(intIndexUnderscore + 1);

    //Show the popup
    mpeUser.Show();
}

AnswerRe: UpdatePanel prevents javascript from getting latest value from a control Pin
Not Active22-Jun-10 8:11
mentorNot Active22-Jun-10 8:11 
GeneralRe: UpdatePanel prevents javascript from getting latest value from a control Pin
Adam Brown 322-Jun-10 9:39
Adam Brown 322-Jun-10 9:39 
GeneralRe: UpdatePanel prevents javascript from getting latest value from a control Pin
Not Active22-Jun-10 9:55
mentorNot Active22-Jun-10 9:55 
QuestionJavascript Print Function is not working Pin
jintalPatel22-Jun-10 6:18
jintalPatel22-Jun-10 6:18 
AnswerRe: Javascript Print Function is not working Pin
Sandeep Mewara22-Jun-10 7:16
mveSandeep Mewara22-Jun-10 7:16 
Questionloading a simple text file in iframe Pin
netJP12L22-Jun-10 4:27
netJP12L22-Jun-10 4:27 
AnswerRe: loading a simple text file in iframe Pin
jintalPatel22-Jun-10 4:43
jintalPatel22-Jun-10 4:43 
GeneralRe: loading a simple text file in iframe [modified] Pin
netJP12L22-Jun-10 5:07
netJP12L22-Jun-10 5:07 
QuestionASP COOKIES Pin
graeme138322-Jun-10 3:36
graeme138322-Jun-10 3:36 
AnswerRe: ASP COOKIES Pin
Not Active22-Jun-10 4:17
mentorNot Active22-Jun-10 4:17 
AnswerRe: ASP COOKIES Pin
R. Giskard Reventlov22-Jun-10 4:49
R. Giskard Reventlov22-Jun-10 4:49 
Questionsource files without .sln or .vbproj files Pin
Alberto De Caro21-Jun-10 23:44
Alberto De Caro21-Jun-10 23:44 
AnswerRe: source files without .sln or .vbproj files Pin
meeram39522-Jun-10 1:05
meeram39522-Jun-10 1:05 
AnswerRe: source files without .sln or .vbproj files Pin
Alberto De Caro22-Jun-10 1:10
Alberto De Caro22-Jun-10 1:10 
GeneralRe: source files without .sln or .vbproj files Pin
meeram39522-Jun-10 1:24
meeram39522-Jun-10 1:24 
AnswerRe: source files without .sln or .vbproj files Pin
Martin Jarvis22-Jun-10 1:24
Martin Jarvis22-Jun-10 1:24 
Questionproblem with xmldocument Pin
Rohit16db21-Jun-10 21:26
Rohit16db21-Jun-10 21:26 

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.