Click here to Skip to main content
15,795,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi..
i have two pages one is HTML and other one is aspx. i need to pass a value from html page using javascript to aspx page. i already tried in getElementByid method but it passing null value only. that code is
C#
function call()
{
var value = getQuerystring('queryvalue');
var value1= "'true'";
var str="www.mcamdois.com/sitemap.htm";
  document.getElementById("Hidden1").value=str;
//alert(value)
//alert(value1);
if(value!=value1)
{
window.location='Default5.aspx';
value="'true'";
}
else
{
return true;
}
return true
}
Posted
Updated 14-Dec-10 3:13am
v2
Comments
Toniyo Jackson 14-Dec-10 8:14am    
Always write your code inside code block.
fjdiewornncalwe 14-Dec-10 11:02am    
Toniyo... If you're going to edit the question by adding pre tags, fix the tabbing as well, please. Adding the pre tags alone doesn't make the code all that much more readable.

You can't just reference a page a pass values between them like you would a Windows form. Think about the nature of the web. Pages are served to a browser based on a request. If you need to pass values between HTML and ASP.NET pages you will need to use a querystring so the data is passed along with the request.
 
Share this answer
 
Comments
ramuksasi 14-Dec-10 8:59am    
thanks for ur suggestion friend..
1) Write window.location='Default5.aspx?param=' + value;

2) In the Default5 page, write the following code to get the value in the page load.
if(null != Request.QueryString["param"])
{
    string mstrParamValue = Request.QueryString["param"];
}
 
Share this answer
 
v2
Comments
Toniyo Jackson 14-Dec-10 8:27am    
Always write your code inside code block.
Hiren solanki 14-Dec-10 8:43am    
Yes there's a way to accomplish, A good idea.
ramuksasi 14-Dec-10 8:59am    
thanks for ur suggestion friend..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900