Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
I have aspx page(uses master page), which has two iFrame
1. it contains dropdown list to filter the data
2. it holds the data to be displayed

My problem is, in 1st iFrame through javascript I'm setting 2nd iFrame src depending upon the dropdown value selected. 2nd iFrame src URL contains parameter in the query string

eq. wf_PrjEstDetails.aspx?id=0"

but when I try to access the parameter in the querystring in the wf_PrjEstDetails.aspx page using Request.QueryString["id"], it gives me null value.

Can you please tell me how i can pass and access the parameter in the querystring ?

This is my JavaScript Method:
JavaScript
function openWinSPV(strPath, object,objname)
{
   var selectedText = window.parent.frames(0).window.document.getElementById('ddlAccount').selectedIndex;
   var drpacc = window.parent.frames(0).window.document.getElementById('ddlAccount').options[selectedText].text;
   if(drpacc.indexOf("Select")!=-1)
   {
      alert('Please select an account!!!');
      return false;
   }

   selectedText = window.parent.frames(0).window.document.getElementById('ddlContract').selectedIndex;
   var drpcontract = window.parent.frames(0).window.document.getElementById('ddlContract').options[selectedText].text;
   if(drpcontract=="" ||drpcontract.indexOf("Select")!=-1)
   {
      alert('Please select the Contract!!!');
      return false;
   }
   selectedText = window.parent.frames(0).window.document.getElementById('ddlAccount').selectedIndex;
   //var arg= window.parent.frames(0).window.document.getElementById('ddlAccount').value;
   var arg= window.parent.frames(0).window.document.getElementById('ddlAccount').value;
   //alert(arg);
   strPath+="&id1="+ arg;
   arg= window.parent.frames(0).window.document.getElementById('ddlContract').value;
   //alert(arg);
   strPath+="&id2="+ arg;
   //if(window.parent.frames(0).window.document.getElementById('hdGrpCtr').value>0)
   
   if(window.parent.frames(0).window.document.getElementById('lblGrName')!= null)
   {  arg= window.parent.frames(0).window.document.getElementById('ddlGroup').value;
      //alert(arg);
      strPath+="&id3="+ arg;
   }
   else
   {       
      strPath+="&id3=0";
      arg=window.parent.frames(0).window.document.getElementById('ddlEstimate').value;
      strPath+="&id4="+ arg;
      strPath = strPath + "&random='" + Math.random() + "'"; //Added for call ID - 94483 to avoid caching of pages
      alert(strPath);
      window.parent.frames(2).document.location.href = strPath;
      //var newWindow=window.open(strPath,object);
      //newWindow.focus();
    }

I have written jquery method in wf_PrjEstDetails.aspx page
JavaScript
$(document).ready(function () {
                var qs = window.location.toString(); //.split("?")[1];
                //qs = qs.replace("id=", "");
                alert(qs);
                //                return qs;
            });

It gives some URL with encrypted parameters, is this reason in code behind it is not able to find id in QueryString??

Any idea??

Thanks in advance
Posted
v5
Comments
pradiprenushe 11-Sep-12 1:27am    
Can u paste code? How does page postback after iframe src change?
Karthik Harve 11-Sep-12 1:43am    
show the code how you are assiging the src for iframe.
dhage.prashant01 11-Sep-12 2:23am    
This is my JavaScript Method:
function openWinSPV(strPath, object,objname)
{var selectedText = window.parent.frames(0).window.document.getElementById('ddlAccount').selectedIndex;
var drpacc = window.parent.frames(0).window.document.getElementById('ddlAccount').options[selectedText].text;
if(drpacc.indexOf("Select")!=-1)
{
alert('Please select an account!!!');
return false;
}

selectedText = window.parent.frames(0).window.document.getElementById('ddlContract').selectedIndex;
var drpcontract = window.parent.frames(0).window.document.getElementById('ddlContract').options[selectedText].text;
if(drpcontract=="" ||drpcontract.indexOf("Select")!=-1)
{
alert('Please select the Contract!!!');
return false;
}
selectedText = window.parent.frames(0).window.document.getElementById('ddlAccount').selectedIndex;
//var arg= window.parent.frames(0).window.document.getElementById('ddlAccount').value;
var arg= window.parent.frames(0).window.document.getElementById('ddlAccount').value;
//alert(arg);
strPath+="&id1="+ arg;
arg= window.parent.frames(0).window.document.getElementById('ddlContract').value;
//alert(arg);
strPath+="&id2="+ arg;
//if(window.parent.frames(0).window.document.getElementById('hdGrpCtr').value>0)
if(window.parent.frames(0).window.document.getElementById('lblGrName')!= null)
{ arg= window.parent.frames(0).window.document.getElementById('ddlGroup').value;
//alert(arg);
strPath+="&id3="+ arg;
}
else
strPath+="&id3=0";
arg=window.parent.frames(0).window.document.getElementById('ddlEstimate').value;
strPath+="&id4="+ arg;
strPath = strPath + "&random='" + Math.random() + "'"; //Added for call ID - 94483 to avoid caching of pages
alert(strPath);
window.parent.frames(2).document.location.href = strPath;
// var newWindow=window.open(strPath,object);
// newWindow.focus();
}
dhage.prashant01 11-Sep-12 2:25am    
I have written jquery method in wf_PrjEstDetails.aspx page

$(document).ready(function () {
var qs = window.location.toString(); //.split("?")[1];
//qs = qs.replace("id=", "");
alert(qs);
// return qs;
});

It gives some URL with encrypted parameters, is this reason in code behind it is not able to find id in QueryString??

Any idea??

1 solution

XML
<% Int64 ss =Convert.ToInt64( Request.QueryString["id"].ToString());%>
                       <% string bb = ss.ToString().Insert(0, "testing.aspx?id="); %>

                           <iframe  src="<%=bb %>"   style="height: 100%; width: 100%; border: 0px;">
                           </iframe>
 
Share this answer
 

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