0

I have a child aspx page in an iFrame. There are a few textboxes, which are populated in the page load event.

There is also a LinkButton which the user clicks when s/he is finished editing the fields. There are some javascript functions and other things going on, so a full postback (ie: asp button) is out of the question.

Problem is, I need to reference the textboxes NEW values (user changes) after the linkbutton is clicked.

Is there any way to do this?

Thanks,

Jason

EDIT:

After playing with the interface a bit further, I realized the Page_Load event was firing as soon as the LinkButton was clicked. Of course this is where the data is initially loaded, so any changes the user made is immediately written over. Current plan of attack is to create an IsLoaded cookie value and check if true before the mentioned code executes. If anybody has a better idea, please let me know!

Thanks,

Jason

2 Answers2

1

You can use jQuery to grab the textbox value on click of the button.

<script type="text/javascript">

$(document).ready(function() {

    $('.btnSubmit').click(function(e) {


        alert($("#txtName").val());
    });
});

Then you may pass this textbox value to a server side method by calling it using jQuery AJAX. See the link below .

http://weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax.aspx

jmisra
  • 21
  • 2
0

You want to access the new textbox values from the parent or from within iframe which has that webform opened?

Yellowcake
  • 116
  • 3
  • 9
  • ie: the iFrame's source is "child.aspx", and I need to reference the new values from the linkbutton's onclick in "child.aspx.vb" –  Jul 15 '11 at 17:08
  • there are achieve many ways to do this. where as the 'Button1' is the name of the button, you can also replace it with <%=Button1.ClientId%>, also you can replace "return true" with "return false" to stop the postback! – Yellowcake Jul 15 '11 at 17:41