How to avoid text boxes text clear when child popup show modal dialogue closed?

Posted by Hemanth.Gottipati under ASP.NET on 9/11/2013 | Points: 10 | Views : 3449 | Status : [Member] | Replies : 7
Hi,
I have two text boxes,one link button and one button in the page,once i am entered text boxes text and click on link button show modal dailogue window opened and after closing the window the text boxes text cleared automatically,but i dont want to two textboxes text clear?
i am mentioned enableviewstate = true also but the issue was not solved can any one please help?




Responses

Posted by: Bandi on: 9/11/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer this link
http://forums.asp.net/t/1552778.aspx
http://wiki.asp.net/page.aspx/282/passing-value-from-popup-window-to-parent-form39s-textbox/

How to receive value from popup page to parent page?
http://www.dotnetfunda.com/articles/article994-how-to-receive-value-from-popup-page-to-parent-page.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 9/11/2013 [Member] Starter | Points: 25

Up
0
Down
Hi thanks for reply
passing two values between parent to child and child to parent is simple..but 20 text boxes in one page scenario its difficult to write that logic,for example i am saying 2 textboxes actually in my page contain 20 textboxes at that scenario how to fix my issue?

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/11/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
You can use as follows for multiple text boxes....
foreach (Control Filltext in this.Controls)

{

if (Filltext is TextBox)
{

((TextBox)Filltext ).Text = Filltext.Text ;

}

}


Have you referred this one
How to receive value from popup page to parent page?
http://www.dotnetfunda.com/articles/article994-how-to-receive-value-from-popup-page-to-parent-page.aspx


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 9/11/2013 [Member] Starter | Points: 25

Up
0
Down
yes i am seen above link but my issue is not receive values from child page to parent page..
my bug is parent page text boxes text clears when child page is closed..
i want parent page text boxes not cleared when closing child popup window

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/11/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Can you send us the code which you tried?

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 9/11/2013 [Member] Starter | Points: 25

Up
0
Down
Hi sending the code is very difficult so i am sending screen shots of my application
1st screen i am entered HPI and code status text boxes with some text after that
2nd screen shows after entered data click on allergies link button and open a child popup window after close button click
3rd screen will display. in 3rd screen there is no previously entered text in HPI and Code status
this is my issue
 Download source file

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 9/12/2013 [Member] Starter | Points: 25

Up
0
Down
Finally i got the logic the text box text maintained in session with javascript
.aspx :
<script type="text/javascript" >
{
var strTest = eval(document.getElementById('<%=txthpi.ClientID%>')).value;
PageMethods.CreateSessionViaJavascript(strTest);
}
</script>
Server sid e :
[System.Web.Services.WebMethod]
public static string CreateSessionViaJavascript(string strTest)
{
Page objp = new Page();
objp.Session["HandPhpi"] = strTest;
return strTest;
}


after that in page load event

if (Session["HandPhpi"] != null && Session["HandPhpi"] != "")
{
txthpi.Text = Session["HandPhpi"].ToString();
}

Thanks....

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response