473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

session

How do I use Session["videopath"] found in BlogListing.aspx.cs in

BlogListing.aspx. For example:

<param name="movie" value="Untitled-1.swf?thePath=qbert.flv" />

I want to replace qbert.flv with Session["videopath"]. The full coding
is as bellow.
BlogListing.aspx
----------------

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="BlogListing.aspx.cs" Inherits="_Default" %>

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

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>

<body>
<form id="form1" runat="server">
<table border="0" width="786" height="283">
<tr>
<td rowspan="9" height="277" style="text-align: center; width: 410px;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=8,0,0,0" width="390" height="277" id="Untitled-1"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Untitled-1.swf?thePath=qbert.flv" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="Untitled-1.swf?thePath=qbert.flv" quality="high"
bgcolor="#ffffff" width="320" height="240" name="Untitled-1"
align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</td>
<td width="360" bgcolor="#FFCC99">
<p align="center"><b>Personal Blogging</b></td>
</tr>
</table>
</form>
</body>
</html>

BlogListing.aspx.cs
-------------------

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
LoadData();
}

private void LoadData()
{
String videoID = Request.QueryString["VideoID"];

SqlConnection cnn = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["myConnection"].Con
nectionString);
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnn;
myCommand.CommandText = "SELECT Video.VideoID, Video.RegistrationID,
Video.VideoPath, Category.Description FROM Video, Category WHERE
Video.VideoID=" + videoID + " AND Video.CategoryID =
Category.CategoryID";
myCommand.CommandType = CommandType.Text;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "Video");

Session["videopath"] =
ds.Tables[0].Rows[0].ItemArray.GetValue(3).ToString();

rptItems.DataSource = ds;
rptItems.DataBind();
}
protected void rptItems_ItemCommand(object source,
RepeaterCommandEventArgs e)
{
LoadData();
}
}
Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***
Feb 5 '07 #1
1 1412
Hello Eugene,

have you tryed this:
<param name="movie" value='<%= Session["videopath"].ToString() %>' />
I hope this should work.

Be careful this is simple example, it fail if session does not contain
videopath.

Regards,
Ladislav Mrnka

"Eugene Anthony" wrote:
How do I use Session["videopath"] found in BlogListing.aspx.cs in

BlogListing.aspx. For example:

<param name="movie" value="Untitled-1.swf?thePath=qbert.flv" />

I want to replace qbert.flv with Session["videopath"]. The full coding
is as bellow.
BlogListing.aspx
----------------

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="BlogListing.aspx.cs" Inherits="_Default" %>

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

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>

<body>
<form id="form1" runat="server">
<table border="0" width="786" height="283">
<tr>
<td rowspan="9" height="277" style="text-align: center; width: 410px;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=8,0,0,0" width="390" height="277" id="Untitled-1"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Untitled-1.swf?thePath=qbert.flv" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="Untitled-1.swf?thePath=qbert.flv" quality="high"
bgcolor="#ffffff" width="320" height="240" name="Untitled-1"
align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</td>
<td width="360" bgcolor="#FFCC99">
<p align="center"><b>Personal Blogging</b></td>
</tr>
</table>
</form>
</body>
</html>

BlogListing.aspx.cs
-------------------

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
LoadData();
}

private void LoadData()
{
String videoID = Request.QueryString["VideoID"];

SqlConnection cnn = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["myConnection"].Con
nectionString);
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnn;
myCommand.CommandText = "SELECT Video.VideoID, Video.RegistrationID,
Video.VideoPath, Category.Description FROM Video, Category WHERE
Video.VideoID=" + videoID + " AND Video.CategoryID =
Category.CategoryID";
myCommand.CommandType = CommandType.Text;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "Video");

Session["videopath"] =
ds.Tables[0].Rows[0].ItemArray.GetValue(3).ToString();

rptItems.DataSource = ds;
rptItems.DataBind();
}
protected void rptItems_ItemCommand(object source,
RepeaterCommandEventArgs e)
{
LoadData();
}
}
Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***
Feb 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
1
by: mudge | last post by:
I'm running PHP Version 4.3.10. I'm trying to make it so that when a person logs in using a user name and password that their session is valid and continues for a few months so they don't have to...
6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
14
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and...
7
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I...
0
by: TRB_NV | last post by:
I'd been using an Access database based shopping cart, but wanted to change it so that it would use session variables. I have a form that's submitted to a page called addtocart.asp that contains...
1
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking...
5
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.