Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:

XML
<%@ 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&lt;/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;">&lt;/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>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</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;

/// <summary>
/// Summary description for BindList
/// </summary>
public class BindList
{
    public BindList()
    {
        //
        // TODO: Add constructor logic here
        //
    }


    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.
Posted
Updated 14-Mar-13 8:18am
v3
Comments
ZurdoDev 14-Mar-13 14:27pm    
Sorry, too much for me to read. Can you simplify down to exactly what the issue is?
[no name] 15-Mar-13 5:53am    
ya sure .

i have one master page one user control in this user control we have a iframe and menu list when i click on any of link the corresponding page loads in iframe. now i have one content page when i run my program i will have content page on browser then i click on ling corresponded page loads . now the pages that we have in iframe have some dropdown and i wand to add tooltip to evry dropdown and also some dropdown have some server control like sect index change . if i add java script on each iframe page then it will work but when i fire selcte index change event on dropdown it goes to server and tool tip remove from dropdowns . so what i can i do for all i frame page by adding java script on conten page so every i frame page swhow tooltip on load and as well as after fire selected index changing event
sri senthil kumar 15-Mar-13 1:12am    
Hey you have already raised question on this right?
http://www.codeproject.com/Questions/561726/wantplustoplusaddplustooltipplusonplusdropdown?cmt=414283#cmt2_561726

I think that has been answered try those solutions... 3rd solution i gave there will be similar to your requirememt you just neet to put that script and pass Iframe ID then everything works fine.

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