[RESOLVED]How to show page2 grid data in page1 after submit click button

I have a button submit on page1 where i am calling the below function under validate onclientclick event
 function sample() {

            var fromDate = $find("<%= rdtpDateFrom.ClientID %>").get_selectedDate().toLocaleDateString("en-US");

            var toDate = $find("<%= rdtpDateTo.ClientID %>").get_selectedDate().toLocaleDateString("en-US");
            var features = "left=100,top=100,height=1110,width=1440,status=no,resizable=yes,toolbar=no,menubar=no,location=no";
            window.open("../caseload_historicaltrend.aspx?fDate=" + fromDate + "&tDate=" + toDate, "_blank", features, false);

        }

 

My question is instead of opening a new page how can we show the data under submit button..

Any idea plz..

 

You can use jqeury.post - http://api.jquery.com/jquery.post/ to call the aspx page and the response you get out of it can be assigned to div as the jquery.html() or jquery.text(). Place this div below the
submit button.

Hi mcfarlandparkway,

mcfarlandparkway

function sample() {
            var fromDate = $find("<%= rdtpDateFrom.ClientID %>").get_selectedDate().toLocaleDateString("en-US");
            var toDate = $find("<%= rdtpDateTo.ClientID %>").get_selectedDate().toLocaleDateString("en-US");   
            var features = "left=100,top=100,height=1110,width=1440,status=no,resizable=yes,toolbar=no,menubar=no,location=no";              
            window.open("../caseload_historicaltrend.aspx?fDate=" + fromDate + "&tDate=" + toDate, "_blank", features, false);
        }

According to your code, it will create a new window, if you don’t want to use a new window, you could modify you code as below. I will create a new tab.

function sample() {
            var fromDate = $find("<%= rdtpDateFrom.ClientID %>").get_selectedDate().toLocaleDateString("en-US");
            var toDate = $find("<%= rdtpDateTo.ClientID %>").get_selectedDate().toLocaleDateString("en-US");   
            window.open("../caseload_historicaltrend.aspx?fDate=" + fromDate + "&tDate=" + toDate);
        }

More details about Window open() Method, please refer to this link.

http://www.w3schools.com/jsref/met_win_open.asp

Besides, you could also try to use Iframe Tag. Please refer to this sample.

    <script type="text/javascript">
        function OpenWindow() {
            var data="Hello World!"
            var item = document.getElementById("ShowPage");
            item.src = "IframeTest.aspx?data="+data;
        }
    </script>

  <div>
        <a onclick="OpenWindow()">Click Me</a>
        <iframe id="ShowPage" src=""></iframe>
    </div>

Best Regards,
Dillion

Thank you for replying..

I am using this sample method where its navigating to another page under validate method.My question is i am doing some date validations under validate …on  button click i added onclientclick – returns to validate function …how to place this sample function
under validate..because first i need to check the date validations then only when the user click on submit it takes to another page.. 

for testing purpose i added sample() under validate now the below date validations are not working…

function validate() {
Sample();
var summary = "";
summary += isvaliddate();
summary += isvalidDatefrom();
summary += isvalidDateto();
if (summary != "") {
alert(summary);
return false;
}
else {
return true;
}
}

Hi mcfarlandparkway,

From your description, I suppose you want to validate the date, if it is validated, it will redirect to another page. Now, the issue is after you add the Sample function the date validations
not working. If that is the case, try to remove the Sample function and check if the date validations working or not. If it is working, the issue is related to the Sample function, please check this function.

Best Regards,
Dillion

Leave a Reply