Last post Sep 15, 2008 03:52 PM by mabellez
Sep 04, 2008 05:50 PM|mabellez|LINK
The problem is the "text" of the btnFailureReport was changed only for look. If I want to save the text to the database, I found the text is still the old text. So I put the two alert box (commented out) in the function to test. The result for the first
one (ctrl.value) is the "hello" which is right. But the result for the second one (ctrl.text) is "undefined", which means the "text" was not changed.
Does anybody knows how to fix this problem?
var ctrl =document.getElementById("ctl00_ContentPlaceHolder1_tcRMACAR_TabPanelCAR_tabPanelInsideCar_tpContainment_btnFailureReport");
ctrl.value = "hello";
ctrl.text = ctrl.value;
Sep 04, 2008 08:03 PM|mabellez|LINK
I tried to put this code inside the GetFileName() function:
and add a function in C# code:
public void SetData(string txt)
btnFailureReport.Text = txt;
lbFailure.Visible = true;
lbFailure.Text = "txt: " + btnFailureReport.Text;
It does not run until I click on the button. Also, after I click on the button, lbFailure shows the right content.
Sep 04, 2008 08:22 PM|Damien12345|LINK
Sep 04, 2008 08:37 PM|tchaitanya|LINK
saving into DB
Sep 04, 2008 08:52 PM|mabellez|LINK
Not sure how to do that: using __EVENTTARGET and __EVENTARGUMENT, change the text of button while saving into DB
Sep 05, 2008 06:14 AM|vjay|LINK
just look over this article
Sep 05, 2008 06:37 AM|TonyDong|LINK
Sep 05, 2008 03:35 PM|mabellez|LINK
Thank you! I'm not sure what do you mean by using Request.Form["__EVENTTARGET "] to get button name.
I know the button ID. it's btnFailureReport.
Sep 05, 2008 04:05 PM|mabellez|LINK
Sep 05, 2008 05:22 PM|TonyDong|LINK
If you want to save the text changes to the database, you could use ajax, it will get the new value you changed.
This video will show you how to use ajax
Sep 15, 2008 03:52 PM|mabellez|LINK
I figured it out. Use a hiddenbutton to record the value. Then get the value from the hiddenbutton after post back. Hiddenbutton is the key.