0

I have a control page on which I am setting certain parameters which I want to control. The page is in aspx and when i click submit i want that data on the textbox of an .htmpage. As in html I dont have C# file so how do I do this?

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<iframe src="http://10.112.90.131/index.htm" border="0" frameborder="0" height="600" width="800"></iframe>

</asp:Content>
SPandya
  • 1,161
  • 4
  • 26
  • 63
  • Where is this HTML-file, on the server or somewhere else? – Tim Schmelter Nov 27 '13 at 09:14
  • remote server. actually I am dealing with two servers. the aspx page will store the data into the sql server and simultaneously i want it on the html page as well. – SPandya Nov 27 '13 at 09:15

1 Answers1

1

I think you should use aspx page instead of html although you can transfer value through aspx to html through query string and parse query string through JQuery / JavaScript.

Suppose Below is the Query String from aspx page to open Html page.

http://stackoverflow.com/ShowData.htm?firstname=jhon

Now JQuery / JavaScript code on remote html would be:-

   $(function () {
       //Setting textbox value to jhon as per querystring
      $("#SomeTextBoxID").val(getParameterByName("firstname"));
    }
    function getParameterByName(name) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
       return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }
panky sharma
  • 2,029
  • 28
  • 45
  • Thanks for the answer but the for me I have to use html page as the second server apart from my main server where this page is located is not supporting aspx. It only supports html. So just to be clear the aspx and html both are in different server – SPandya Nov 27 '13 at 09:42
  • I unable to understand it? Clarify me how will you open it (Remote html page) .. Suppose a user submitted the information on aspx and you want to open and display entered aspx data on a remote html page, ie. domain hosted on another server. is that correct? – panky sharma Nov 27 '13 at 10:01
  • Yeah, What actually my thought is (totally hypothetical) I can redirect it on to the that page(html situated in another server) on the button click and after may be somehow I can copy/display the data on the html page – SPandya Nov 27 '13 at 10:03
  • So what are the odds.. Just send info in query string just like this somedomain.com/ShowData.htm?firstname=jhon ....Either Redirect to the html page or open remote html as a popup check this ans: show external page into model pop up http://stackoverflow.com/questions/12137033/load-external-url-into-modal-jquery-ui-dialog – panky sharma Nov 27 '13 at 10:19
  • A thought just pop up in my mind that can I call that html page using ` – SPandya Nov 27 '13 at 10:21
  • of course you can use iframe infact iframe would be more suitable...you can take Ifame contro (runat server) and make its query string dynamic OR ..just use jquery to make its query string dynamic Something like.....$("#Ifram").attr("src", "www.Pages.com/some_other_html_page.html?firstname=" + "'<%=firstName%>' +'" ); ***First name is a pubic variable in code behind – panky sharma Nov 27 '13 at 10:28
  • See the updated code I am not able to click the submit button on the html page – SPandya Nov 27 '13 at 10:44