I have an issue where I am using a master page. I am loading content into the content place holder. Based on what is selected in my datagrid it will do a response.write for a video to pop up. My issue is the video loads into the top of the page before my masterpage. I need the video to load into the contentplaceholder or another page would be fine. Here is what I have right now:
public partial class Videos1 : System.Web.UI.Page{ VideoDB objVideo; protected void Page_Load(object sender, EventArgs e) { lblMessage.Text = ""; if (!Page.IsPostBack) { LoadVideo(); } }
protected void LoadVideo() { objVideo = new VideoDB(); int nType = 1; if (Roles.IsUserInRole(HttpContext.Current.User.Identity.Name, "User 1")) nType = 1; else if (Roles.IsUserInRole(HttpContext.Current.User.Identity.Name, "User 2")) nType = 2;
gv.DataSource = objVideo.GetVideoByType(nType); gv.DataBind();
} protected void gv_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName.Equals("PlayVideo")) { int nItemID = int.Parse(gv.DataKeys[0].Value.ToString()); string sTitle = e.CommandArgument.ToString();
objVideo = new VideoDB(); SqlDataReader dBContent = objVideo.GetSingleVideo(nItemID); dBContent.Read();
string sFileName = (String)dBContent["FileName"];
SendEmail(txtName.Text.ToString(), txtEmail.Text, sTitle);
System.Text.StringBuilder sb = new System.Text.StringBuilder("<OBJECT ID='" + this.ClientID + "' name='" + this.ClientID + "' " + "CLASSID='CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000'" + "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'" + "VIEWASTEXT" + "height=300 width= 300>");
//Render properties as object parameters sb.Append("<PARAM name='movie' value='" + @"Video\" + sFileName + "'>"); sb.Append("<PARAM name='quality' value='high'>"); sb.Append("<embed src='" + @"Video\" + sFileName + "' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='320' height='240'></embed>");
Response.Write(sb); } } catch { lblMessage.Text = "Error in processing request."; } }
My issue is with the Response.Write(sb); I need it to load in my "ContentPlaceHolder1" container.