Solved

ASPX PASS GAME ID INTO 5 IFRAMES IN A ASPX PAGE

Posted on 2013-12-03
14
295 Views
Last Modified: 2013-12-05
I have a sorceboard selector and when you click on the linkbutton it puts the game id in url line like http://dev.sportsnetwork.com/aspdata/nba2/NBAGAMECAST.aspx?gameID=18419

The question I have is how do I pass that value in the IFRAME I CAN HARD CODE BUT I need dynamic


HARDCODED
<td><iframe width='100%' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Court4.html?gameID=19055'></iframe></td>
  </tr>

EXAMPLE WHAT CAN i USE USING ASPX TECHNOLOGY
  <tr>
    <td><iframe width='900px' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/tabpanel.html'></iframe></td>
  </tr>
0
Comment
Question by:powerztom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
14 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39693353
Try this :
<iframe width='100%' height='175' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Nbastart1.html?gameID=<%= ID %>'></iframe>

Open in new window

0
 

Author Comment

by:powerztom
ID: 39693484
leakim971 I feel like I'm close I have the code in nba.aspx.vb file like

Partial Class _NBA
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ID As String




        ID = Request.QueryString("gameID")
    End Sub
End Class

Open in new window


Then added what you typed in above. Please Help
so I got two files nba.aspx.vb where request id is called
and nba.aspx Iframes is it two seperate files that are giving me a problem?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39693549
so I got two files nba.aspx.vb where request id is called
and nba.aspx Iframes is it two seperate files that are giving me a problem?

Open in new window

yes, of course

put the same code in each page
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:powerztom
ID: 39693638
I tested each page one at a time they all worked so I put allthe code in one page I even put a button and have the code write the game id to the button aas it's text value which does so I don't get this one maybe IFRAMES Can't accept variables but I swore I did it in the past any way here is the code maybe you'll see something I cannot see

<%@ Page language="vb" Explicit="true" EnableSessionState="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>The Sports Network NBA GAMECAST 2014</title>
</head>
<script language="VB" runat="server" >



Sub Page_Load(Source As Object, E As EventArgs)
        Dim ID As String
   

   

        ID = Request.QueryString("gameID")
        Button1.Text = ID
End Sub
</script>
<body bgcolor="#000000">
    <form id="form1" runat="server">
    <div>
    <table width="750" border="0">
  <tr>
    <td><iframe width='100%' height='175' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Nbastart1.html?gameID=<%=ID%>'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='100%' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Court4.html?gameID=<%=ID%>'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='900px' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/tabpanel.html?gameID=<%=ID%>'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='100%' height='300' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/TeamStatsA.html?gameID=<%=ID%>'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='100%' height='300' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/TeamStatsH.html?gameID=<%=ID%>'></iframe></td>
  </tr>
</table>
    </div>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </form>
</body>
</html>

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 39693685
do a right click somewhere in your main page (not on an iframe) and choose view source
post it here
0
 

Author Comment

by:powerztom
ID: 39695522
OK I can see how game ID IS LIKE gameID=__Page but why?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
	The Sports Network NBA GAMECAST 2014
</title></head>

<body bgcolor="#000000">
    <form name="form1" method="post" action="Default.aspx?gameID=18447" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwODU1OTYyMzUPZBYCAgQPZBYCZg8PFgIeBFRleHQFBTE4NDQ3ZGRkVrxQKp5PVAYeNmXN9QCVKiXVxYU=" />
</div>

<div>

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgKkkuaKBgKM54rGBjrxEjGTnbmuBxEpW6GFrsgRB7AG" />
</div>
    <div>
    <table width="750" border="0">
  <tr>
    <td><iframe width='100%' height='175' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Nbastart1.html?gameID=__Page'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='100%' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Court4.html?gameID=__Page'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='900px' height='400' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/tabpanel.html?gameID=__Page'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='100%' height='300' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/TeamStatsA.html?gameID=__Page'></iframe></td>
  </tr>
  <tr>
    <td><iframe width='100%' height='300' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/TeamStatsH.html?gameID=__Page'></iframe></td>
  </tr>
</table>
    </div>
        <input type="submit" name="Button1" value="18447" id="Button1" />
    </form>
    
</body>
</html>

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 39695687
Use an other variable name instead ID, use myID for example
0
 

Author Comment

by:powerztom
ID: 39695843
Still got

<iframe width='100%' height='175' scrolling='no' frameborder='no' src='http://dev.sportsnetwork.com/aspdata/NBA2/Nbastart1.html?gameID=__Page'></iframe>

MAYBE IT CAN'T BE DONE.
0
 

Author Comment

by:powerztom
ID: 39695921
Now I got Compilation Error  BC30451: Name 'myID' is not declared.

But I did declare this. Fixed this error but still can't pass game id into Iframe and after </script> I guess that it you can't do variables.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39696122
Need to be public :
    <script language="VB" runat="server" >
        Dim MYID As String = "ok"
        Sub Page_Load(Source As Object, E As EventArgs)
            MYID = Request.QueryString("gameID")
            Button1.Text = MYID
        End Sub
    </script>

Open in new window

0
 

Author Comment

by:powerztom
ID: 39696321
I already talked to a co worker and this this needs to be public. So what do you think ? can't be done with IFrames?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39696329
Line 2 made MYID public

Did you tried it with your iframe?
0
 

Author Comment

by:powerztom
ID: 39696673
HOLY SHIT IT WORKED I can't thank you enough I tried it Public but I most have forgotten something Thanks You deserve every point for hanging in there.
0
 

Author Closing Comment

by:powerztom
ID: 39698341
leakim971 I'm sorry I was so happy that it worked I forgot mto give ypou the points and Tell you thanks for being so patient all day yesterday. Your awesome.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best book for Internet security 4 49
jQuery element reference issue 2 36
Convert complicated date to yyyy-mm-dd format 22 45
Json and ajax javascript 24 21
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question