I want to add tool tip on that pages dropdown which is comes in iframe how can I add,i know it is possible when I set javascript function on each page which is called in iframe but I don't want do that because I have to add this javascript function on each page so I want to set this tool tip from master page or user control .
My master page:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<%@ Register src="UserControl/WebUserControl.ascx" tagname="WebUserControl" tagprefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>My Company Master Page</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc1:WebUserControl ID="WebUserControl1" runat="server" />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
My user control:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="UserControl_WebUserControl" %>
<script type="text/javascript">
function Click(str) {
if (str = '1') {
self.frames['frmPageName'].location = "Default6.aspx";
}
if (str = '2') {
self.frames['frmPageName'].location = "Default6.aspx";
}
if (str = '3') {
self.frames['frmPageName'].location = "Default6.aspx";
}
if (str = '4') {
self.frames['frmPageName'].location = "Default6.aspx";
}
if (str = '5') {
self.frames['frmPageName'].location = "Default6.aspx";
}
}
</Script>
<table>
<tr>
<td>
<ul?
<li önclick="Click('1')">1st</li>
<li önclick="Click('2')">2nd</li>
<li önclick="Click('3')">3rd</li>
<li önclick="Click('5')">4th</li>
<li önclick="Click('6')">5th</li>
</ul>
</td><td colspan="7">
<iframe id="frmPageName" name="frmPageName" frameborder="1" style="height:200px;width:785px;"></iframe>
</td></tr></table>
in this user control I call six pages but I called same page on every click
and my content page:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="Default5" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
</p>
</asp:Content>
and the page which called in I frame og user control:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center" cellpadding="3" cellspacing="4" class="style1">
<tr>
<td class="style2">
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</td>
<td class="style2">
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList3_SelectedIndexChanged"
>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="DropDownList4" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DropDownList5" runat="server">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="DropDownList6" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList6_SelectedIndexChanged"
>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
and .cs file of this page:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Default6 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindList.FillDrop(DropDownList1);
BindList.FillDrop(DropDownList2);
BindList.FillDrop(DropDownList3);
BindList.FillDrop(DropDownList4);
}
}
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
{
BindList.FillDrop(DropDownList6);
}
protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
{
BindList.FillDrop(DropDownList5);
}
}
and Bidlist class:
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public class BindList
{
public BindList()
{
}
public static void FillDrop(DropDownList lc)
{
DataTable workTable = new DataTable();
workTable.Columns.Add("value");
workTable.Columns.Add("text");
DataRow workRow;
workTable.TableName = "MyTable";
for (int i = 0; i <= 9; i++)
{
workRow = workTable.NewRow();
workRow["value"] = i;
workRow["text"] = "CustName" + i.ToString();
workTable.Rows.Add(workRow);
}
lc.DataSource = workTable;
lc.DataTextField = "text";
lc.DataValueField = "value";
lc.DataBind();
}
}
so I want to add tool tip on that pages dropdown which is comes in iframe how can I add,i know it is possible when I set javascript function on each page which is called in iframe but I don't want do that because I have to add this javascript function on each page so I want to set this tool tip from master page or user control .
Thanks please help me on that.