Calling HTML page from ASPX page + sending parameters to the HTML page

Dear EE I am working with ASP.NET2.0, C# And want to call an HTML page from my ASPX page and:

1. I want it to be a popup window.

2. I want to pass 2 parameters to the page that I will call.

Please tell me how to do that,

Thank you

8/20/2007 3:03:32 PM 91979 articles. 4 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 47

 If you're going to be opening the new window from a hyperlink anchor or a form, you need to give a target="_blank" attribute.  By the way, it's not considered good practice to create pop up windows since it makes it hard for accessibility tools like screen readers to make sense of them. 

You can use QueryStrings to pass information, that's the easiest way, but you'll probably need some javascript on the receiving page to pick it out, or make it a classic ASP page.  I'm not sure if you can just post data in a form from ASPX to HTML - does anyone know?

-- Please Mark Posts that helped you as Answers, and share a summary of what solved the problem.
8/20/2007 4:24:40 PM

What you can do is to use javascript to open the HTML page. Add the below code inside the head tag in your aspx page.

<script language=javascript>

function OpenWindow()


return false;



Now for example if you want to open the popup on button1 click add the below code at page_load event of your aspx page

Button1.Attributes.Add("onclick","return OpenWindow();");

Now in Page1.html you can write javascript to retrieve the value of id and second passed using the query string


Haissam Abdul Malak
| Blog |
8/20/2007 5:13:47 PM

thank you doe your nice post

but can you please tell me how to catch these 2 prameters in the MTML page that i will call


thank you

8/21/2007 10:58:35 AM

Ramzy N.Ebeid:

thank you doe your nice post

but can you please tell me how to catch these 2 prameters in the MTML page that i will call


thank you


Based on my understanding, You want to get the parameters in the html page. If I have misunderstood you, please feel free to let me know.

We can use to get the url which contains the parameters, and then get the parameters use JavaScript. For example:

<script type="text/javascript">
function GetParameter()
    //Get the URL
    var href =;

   //Declare an array to contain parameters
    var arg = new Array();
    if ( href.indexOf( "?") != -1)
        var params = href.split( "?")[1];
        var param = params.split("&");

        for (var i = 0; i < param.length; ++i)
            var name = param[i].split( "=")[0];
            var value = param[i].split( "=")[1];

            arg[i] = value;



I hope this helps.

Thomas Sun
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
8/23/2007 10:10:35 AM

Similar Artilces:

Calling ASPX page from HTML page
Was working on three separate Web forms and wanted to have a common front-end to call these up. When the Web forms were set as the Startup form they opened and the form worked. Created an HTML page with three buttons using HREF to link the ASPX pages. The webform pages come up but when trying to work with the forms am getting message that no server is available. Tried to set up a simple form with a text box, a button and a label. Typed something in the textbox, clicked the button and displayed the contents in the label. Same thing happened when linked to this page from a button o...

call Html page from .aspx page
I have created a html page. I want to post that html page with all its control every time user click on the "Add" button on the default.aspx page.If user click "Add" button twice on default page should have visible two html post. thanks for your help. Use to open the HTML page. You can look it up on Google for more information. NC...   Not quite sure why you would want to do that, but if it's simple html (no javascript) then dynamically create a label and import it's text from the html page. Or, using javascript on your aspx page, have it load the file using this: &...

calling aspx page from html page
Hello, I have a html page with a frame..When I click on a link on the html page, I want to load an aspx page into the frame on the html page.. How can I do this? Thanks in advance. Set the Target property of the link equal to the ID of the frame where you want the page to be loaded. Hi, You need to set the name of the target frame. I'll show you a simple code on how to do it. Note that I only have two frames, the left menu and body: Write the following tags in your Frameset.htm. Note that initial aspx being displayed by the html file is the body.aspx. That will be replac...

aspx pages (page cannot be displayed) Html pages works fine
Hi I have successfully copied my website on windows 2003 server with IIS 6.0 and framework 2.0.All my html pages works fine but when i try to open aspx pages it gives me error message (Page cannot be displyed)i have registered aspnet_regiis -i -enablealso done script mapping with aspnet_regiis -s with application path. No GoPlease helpMohit Aneja hi,  You have to enable Execution permission in ISS Properties then only the ASPX pages will workregards,M.Krishna kumar--------------------My Favorite Websites:1. Free Online Exam and Certification Site (,sql serve...

Paging Paging Paging
I am trying to do paging with my search results and it isnt working very well. Here is what I've tried and I feel I've tried everything, lol, please help me out. Sub DataGrid1_SortCommand(Sender as object, e as DataGridSortCOmmandEventArgs) DataGrid1.DataBind() End Sub Sub Datagrid1_PageIndexChanged(Sender as object, e as DataGridPageChangedEventArgs) Dim ds as dataSet DataGrid1.CurrentPageIndex = e.NewPageIndex if Session("Search") is nothing then 'Session probably has expired, get the datasource from database Datagrid1.DataSource = ...

Redirecting /page.html to page.html
HiI have some plain HTML files that I get from an external web server. The files contain links that ALL look like: "/folder/subfolder/page.html". Then I use <% Response.WriteFile("page.html") %> for all files to be included in my page.aspx. Now the problem is that because ALL links are prefixed with a forward slash, it tries to get the file from the root web server not the root application folder. So it tries to get the page from "http://localhost/folder/subfolder/page.html" rather than "http://localhost/webapproot/folder/subfolder/page.html". Ho...

To send Query string from html page to .aspx page
our  project in 2.0 ( 2005) We have develope a login form in .html page (client requirement) and we want to send query string uid and password .html page to .aspx page and we do other work in aspx pages. my question is how can i send query string .html to .aspx page. in your html login page set the action attribute like this I Dont Test The Code .... <form name="LogIn" method="post" action="BuildAction();" > <script language=javascript > function  BuildAction() { var uid=document.getElementById('MyUserText'); var pwd=document....

Calling a HTML page from a aspx page will take localhost as root?
Hi, I've been trying to solve this for quite a while, and I ended up in this. When I call a webpage which is in my C:\TEST\page.html and then try to open in its iframe (With a Browse...button) a file which is also in my C:\TEST, it renders inside the iframe normally. When I invoke the HTML from a hyperlink placed in the aspx page, it somehow takes as a root the localhost, and instead of C:\TEST\page.html I must input http://localhost/TEST/page.html I understand the runat=server gives a root on the script of localhost, but how can I avoid this? Hi,When you are calling C:\TEST, yo...

Converting HTML page into ASPX page
Hi all, I am new to ASP.NET and  I'm really in need of  some help. I am trying to add web controls on my webpages so I converted them from .html  into .aspx. The pages were originally written using  div tags instead of tables for positioning purposes. I also had adobe flash banners on some of them. To my surprise, the background images, colors, banners, and so forth are all gone. I am using Microsoft Visual Studio 2003, and the messages that it generated said something about it not recognizing the div tags and the embed tags used to display flash banners. If you h...

how to convert .aspx page to .html page
how to convert .aspx page to .html page while uploading in 3D FTP PLZ give us any suggessions regarding this issue The only thing I can think of is that you run the apsx page in a browser, then copy and paste the html source code that it produces, save that with an html file extension and upload that.  FTP clients can't convert aspx pages to html. Regards Mike [MVP - ASP/ASP.NET]My site Why would you want to convert it? It will display in any browser as the page will produce html when it is rendered----------------------------------------------Mark helpful posts as "Answe...

POST from aspx page to HTML page
Hi there, Sorry for the simplicity of the question but how would i POST web-form data values from an APSX page to a plain HTML page? Many thanks Ben Change the forms action field to point to the HTML page. <form runat=server action='myPage.html'>//form data goes here</form>James Hearst.NET Application Developer Hi ben21 You can easily use JavaScript like this..<SCRIPT>function checkForm(){ aspnetForm.action="Your page here";aspnetForm.submit(); return true;} </SCRIPT>Code in aspx file<tr>        &n...

Converting .aspx pages into html pages
Dear All, I have  few .aspx pages which make use of master pages,page layouts and web parts to display content. There is a requirement now to convert these to html pages. Any suggestions as to how I can convert .aspx page into .html page?     File -> Save As in Internet Explorer is the quckest way to do it. Thanks.Anand Vijayan--------------------------------------------------If this is your answer please mark it as answered. Explaination of what was said above. All aspx code is actually converted back into html in the browser. aspx makes it nice and easy to do com...

How to generate HTML pages from ASPX pages.
Hi       I want to generate HTML pages for the ASPX dynamically generated pages which are least modified. The targeted HTML page should contain the whole html output of the ASPX page.  How can this be done. Any idea would be warmly appreciated. ZIA UR REHMAN Try this:VB:----Function WebPageToString(urlString As String) As String       Dim uriObject As URI = New URI(urlString)       Dim webRequestObject As WebRequest = WebRequest.Create(uriObject)       Dim webResponseObject As We...

Web resources about - Calling HTML page from ASPX page + sending parameters to the HTML page -

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google Webmaster Tools Parameter Handling - Flickr - Photo Sharing!
You aren't signed in Sign In Help Home The Tour Sign Up Explore Explore Home Last 7 Days Interesting Popular Tags Calendar Most Recent Uploads ...

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 12/6/2015 4:46:53 PM