Category Archives: ImageMap

[RESOLVED] Need to add OnClick code to an ImageMap

I have an imagemap with 3 hotspots.  One downloads a .pdf, the other two redirect to two other websites.  Now they want to be able to track who downloads the .pdf file with our reporting program (VisiStat).  To do that, I have to add some code to the OnClick event of the .pdf hotspot.

<A ONCLICK="VSLT('MyFile.pdf')" TARGET="new" HREF="my-link.pdf">MyFile.pdf</A>


The code in the "VSLT('MyFile.pdf')" can be any name, that's what shows up in the reports.
I've tried doing this with a code behind OnClick event handler, but it can't see the javascript included in the asp page:

<!--VISISTAT SNIPPET//-->
<script type="text/javascript">    var DID = 12345;</script>
<script src="http://sniff.visistat.com/sniff.js" type="text/javascript"></script>
<!--VISISTAT SNIPPET//-->

And I'm guessing that's where the VSLT code is at.
I tried moving my code inline in the asp page, but it always says my sub is not a member of the page. What am I doing wrong? It seems like I'm just calling it or referencing it wrong.
The only code I have in it is an If/Else for the postback values.

Here is the imagemap code:

<center><asp:ImageMap ID="Green_Bar_ImageMap" runat="server" HotSpotMode="PostBack" OnClick="ImageMap_Click()" ImageUrl="http://www.somedomain.com/Images/Heart-RightBodyImage.gif" Height="828" Width="206" ImageAlign="Top" CssClass="Right_Column">

<asp:RectangleHotSpot AlternateText="End Stage Heard Disease and Palliative Care" PostBackValue="PDF" Top="321" Right="185" Bottom="520" Left="30"/>
<asp:RectangleHotSpot AlternateText="Source 1" PostBackValue="source1" Top="726" Right="192" Bottom="758" Left="30"/>
<asp:RectangleHotSpot AlternateText="Source 2" PostBackValue="source2" Top="780" Right="192" Bottom="798" Left="30"/>
</asp:ImageMap></center>

 

Here is the function to handle it (right now in-line in the page):

 

 

<script type="text/VBScript">
        Protected Sub ImageMap_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ImageMapEventArgs)
                If (e.PostBackValue.Contains("PDF")) Then
                          VLST("HeartDiseaseWP.pdf")
                          Response.Redirect("http://www.somedomain.com/WhitePapers/HeartDiseaseWP.pdf")

                ElseIf (e.PostBackValue.Contains("source1")) Then
                           Response.Redirect("http://www.otherdomain.com/questions/end-stage-congestive-heart-failure")

                ElseIf (e.PostBackValue.Contains("source2")) Then
                            Response.Redirect("http://www.otherdomain.org/")
                End If
        End Sub
</script>

 

Hi,

dean.carrefour

<!--VISISTAT SNIPPET//-->
<script type="text/javascript">    var DID = 12345;</script>
<script src="http://sniff.visistat.com/sniff.js" type="text/javascript"></script>
<!--VISISTAT SNIPPET//-->

And I'm guessing that's where the VSLT code is at.
I tried moving my code inline in the asp page, but it always says my sub is not a member of the page. What am I doing wrong? It seems like I'm just calling it or referencing it wrong.

According to your description, I guess the "VSLT" function is a javascript method. It can not simply copy to code behind and run it on server. You need to use ClientScript.RegisterStartupScript to add javascript funtion.

And notice that if you use the Response.Redirect after that, the page will first do the redirect without run the javascript function. Use the javascript redirect instead.

So I think you need to modify the code like:

<script type="text/VBScript"> 
        Protected Sub ImageMap_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ImageMapEventArgs) 
                If (e.PostBackValue.Contains("PDF")) Then 
                          Me.ClientScript.RegisterStartupScript(Me.[GetType](), "VLSTFunctionAndRedirect", "VLST('HeartDiseaseWP.pdf');window.location.href=http://www.somedomain.com/WhitePapers/HeartDiseaseWP.pdf'", True) 
                ElseIf (e.PostBackValue.Contains("source1")) Then 
                           Response.Redirect("http://www.otherdomain.com/questions/end-stage-congestive-heart-failure") 
 
                ElseIf (e.PostBackValue.Contains("source2")) Then 
                            Response.Redirect("http://www.otherdomain.org/") 
                End If 
        End Sub 
</script>

 

Hope this can help you.

[RESOLVED] Adding an ImageButton to the ImageMap control as a child control

Hello

Adding an ImageButton  to the ImageMap control  as a child control.

I am developing a map that will be contained some user-defined nodes. The user can click anywhere of the map to add the node to that location. X locations and Y Locations are stored in the database. Initializing   the page all stored nodes will be created programmatically. My problem is that the created nodes are invisible.  If I replace the ImageMap with a panel control then all dynamically created nodes will be visible but in this situation I cannot capture the X and Y locations.

protected System.Web.UI.WebControls.ImageButton btn;

 

        protected void Page_Load(object sender, EventArgs e)

        {

           

            btn.ImageUrl = “Images/…”

        }

 

        override protected void OnInit(EventArgs e)

        {

           

 

            btn = new ImageButton();

            btn.ID = "btn1";

            btn.Style["Position"] = "Absolute";

            btn.Style["Top"] = "100px";

            btn.Style["Left"] = "100px";

          

            ImageMap1.Controls.Add(btn);//… invisible nodes

           // Panel1.Controls.Add(btn);//… visible nodes

 

 

            base.OnInit(e);

        }

 

So I have one of the following problems:

1.       Adding child to the ImageMap Control

OR

2.       Capturing the mouse X and Y Locations in the panel

Please help me to solve this problem. I am very thankful for any help.

RectangleHotSpot hs = new RectangleHotSpot();
            hs.HotSpotMode = HotSpotMode.PostBack;
            hs.Left = 10;
            hs.Top = 10;
            hs.NavigateUrl = "#";           
           
            Im1.HotSpots.Add(hs);

As can be seen, a hotspot can be added that can postback. Therefore, an image button is not needed.

Hi, thanks for your reply

But if it is possible please give me some points that how your solution would solve my problem. Please consider the following:

1-      My web site has a map. The picture format of the map is jpeg.

2-       Each user can add a node in the map by clicking on it.

3-      After clicking the coordinates(X and Y) of clicked area is captured

4-      Coordinates are saved in the data base

5-      Whenever the page containing the map is loaded, for each coordinates stored in the database a small circle (ImageButton) will be added to the map  

I have two solutions for it:

1-      Using a ImageButton as a map. I can capture the coordinates of the clicked area as follows:

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)

        {

            int X_Location = e.X;

            int Y_Location = e.Y;

        }

The problem is that I cannot add the nodes in the OnInit method by the following code:

 

 

protected System.Web.UI.WebControls.ImageButton btn;// node

 

        protected void Page_Load(object sender, EventArgs e)

        {

           

            btn.ImageUrl = “Images/…”

        }

 

        override protected void OnInit(EventArgs e)

        {

           

 

            btn = new ImageButton();

            btn.ID = "btn1";

            btn.Style["Position"] = "Absolute";

            btn.Style["Top"] = "100px";// this value can be retrieved from the database

            btn.Style["Left"] = "100px";// this value can be retrieved from the database

          

            ImageButton1.Controls.Add(btn);

 

 

            base.OnInit(e);

        }

The problem of this solution is that the programmatically added nodes are not visible

 

2-  As an alternative for ImageButton I can use a panel to display the map (BackImageUrl="~/Images/map.jpg"). after creating the btn programmatically I use the following code to add it to the panel:

 

Panel1.Controls.Add(btn);

 

Hear the problem is that I cannot capture the coordinates by clicking on the map

 

 

I need to enable the user to add the nodes to the map and view them in a single interface.

 

I hope to get your kindly solutions for this problem. I will very thankful for helps.

Hi, Please help me. I am in trouble...

Thank you

Hi,

koohbor323

Hear the problem is that I cannot capture the coordinates by clicking on the map

According to your description, for my experience you can use javaScript function to get the position when the mouse is clicked.

koohbor323

I need to enable the user to add the nodes to the map and view them in a single interface.

I would like to suggest you to check the complete sample below which shows how to capture the position when mouse is clicked and how to create the image buttons dynamically in a web page by using the value of position.

1.Code in page(.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
    function clicked(e) {
    var hiddenX = document.getElementById("<%=hiddenX.ClientID %>");
    var hiddenY = document.getElementById("<%=hiddenY.ClientID %>");
    hiddenX.value = e.clientX;
    hiddenY.value = e.clientY;
    document.getElementById("<%=Button1.ClientID %>").click();
        }
    </script>
</head>
<body>
    <form id="Form2" runat="server">
    <div runat="server" id="btnDIV" onclick="clicked(event)" style="position:Absolute;background-image:url('http://i.microsoft.com/global/en-us/homepage/PublishingImages/Hero/VS2010b_530x320_dk.jpg');width:600px;height:400px"></div>
    
    <asp:HiddenField ID="hiddenX" runat="server" />
    <asp:HiddenField ID="hiddenY" runat="server" />
    <asp:Button ID="Button1" runat="server" Text="AddButton"
        onclick="Button1_Click" />
    </form>
</body>
</html>

2.Code in page(.cs):

   protected void Page_Load(object sender, EventArgs e)
    {
        this.Button1.Attributes.Add("style", "display:none");
        // Recreate the image buttons when page post back.
        AddButtonDynamically();
    }
    public void AddButtonDynamically()
    {
        if (ViewState["button"] != null)
        {
            Hashtable table = (Hashtable)ViewState["button"];
            for (int i = 0; i < table.Count; i++)
            {
                AddBtn(i, table[i].ToString());
            }
        }
        else
        {
            Hashtable table = new Hashtable();
            ViewState["button"] = table;
        }
    }

    // Create an image button by using the value of mouse's position.
    public void AddBtn(int i, string values)
    {
        ImageButton btn = new ImageButton();
        btn.ID = "btn_" + i;
        btn.ImageUrl = "http://www.microsoft.com/en-us/homepage/shared/templates/components/hpFooter/images/microsoft.png";
        string[] position = values.Split(',');
        btn.Style["Position"] = "Absolute";
        btn.Style["Top"] = (Convert.ToInt32(position[1])-15).ToString() + "px";
        btn.Style["Left"] = (Convert.ToInt32(position[0]) - 15).ToString() + "px";
        btn.Click += new ImageClickEventHandler(btn_Click);
        this.btnDIV.Controls.Add(btn);
    }

    void btn_Click(object sender, ImageClickEventArgs e)
    {
        Response.Write("My Position is :<br/> X: " + e.X + " Y: " + e.Y);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Hashtable table = (Hashtable)ViewState["button"];
        int count = table.Count;
        string top = hiddenY.Value;
        string left = hiddenX.Value;
        string values = left + "," + top;
        AddBtn(count, values);
        table.Add(count, values);
        ViewState["button"] = table;
    }

Hope it can help you.

@Ming Xu - MSFT: Thank you for your helpSmile

[RESOLVED] Pass email addresses between pages so they're not capturable

Hi,

I want to pass email addresses between pages so they can't be captured by bots. Page1 has people's names within paragraph texts and imagemaps. I'd like users to be able to click on the name or imagemap, taking them to a form (page2) to send that person an email.

example
page1:

Paragraph of text mentioning [link]Jim[/link] and why you should contact him, next to an imagemap linked the same way.
More paragraphs mentioning other people who can be contacted the same way.

page2:

[h3]Contact Jim[/h3] (Jim's name is also passed from page1.)
Contact Form
[Submit] Sends Jim an email

I've looked at session variables, query strings and using "sName = Context.Items("UserName").ToString". That last one seems only usable with aspx. I'm not up with aspx, have limited understanding of vb and want to avoid js.

All suggestions gratefully received.
Thanks

[Edited for typos]

You can use Session as well as query strings just encrypt information before sendin it by either technique.

Another approach is to use HTTPS instead of HTTP.

If you are sending the email from server side code you never need to have the email address client side, simply use the name, "jim" in your example, to lookup the email address in your data store on the server and then send the email to that address.

Thanks Manvel and frez

Manvel, I had been thinking along a similar line, but wondered if I was missing an easier option. Thanks :) Sounds like the way to go.

frez, I'd thought of this too. It's a good solution, but the way this site is setup, I think Manvel's method is probably more suitable.

Thanks folks for the help. Much appreciated.

sorry.. duplicate due to long lag

Convert GraphicsPath to HTML image map coords

Hi,
I have a monochrome bitmap that I create a GraphicsPath from (adds rectangles for all black pixels in the image and adds them to the path). Is there anyway to convert this GraphicsPath to image maps coords?

I'm pretty stuck, so any help is appreciated.

Regards,
Anders Pettersson

Hi,

In this case, I suggest using ImageMap Web server controls instead, which enables us to create an image that has hot spots.

For much about ImageMap control, please refer to:

http://msdn.microsoft.com/en-us/library/ms228207.aspx

Hi,

I looked at the ImageMap webcontrol, but I don't really know how to solve the problem. My problem is that I use a bitmap mask, ie. a bitmap with a black mask in it (rest is white), which can be pretty advanced. And I need to get the polygon points which I can't find out how to do. [:S]

Try to use HTML <map> tag.

http://www.w3schools.com/TAGS/tag_map.asp

Or use Flash to do it but I failed to find a tutorial for you.

Thanks for your reply ASPNetEngineer. I'm using the <map> tag today, and I can get it to work, by makin a rect for every single rect in the GraphicsPath. So basically I'm looking for a better solution, since it generates A LOT of rects. But I'm starting to think it'll pretty hard to find a solution for it. [:(]

I create: http://kem.110mb.com/php/tool_map2.htm hope to you ok

[RESOLVED] Wizard control AutoFormat - incorrect font size on first rendering (VS 2008)

As part of an exercise, I have created an ASP.NET page with various controls on it.  One of the controls is a Wizard control.  Can anyone help me figure out why, on the first viewing of the page in a browser, the Wizard contol's font size is different from that of subsequent views resulting from postbacks?  It doen't happen on other pages, so there must be something on this one page that is causing the problem.

Here is the source code of the ASP.NET page:

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

<!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>Page 140 :: 1st Practice 1</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p>This is simple HTML static text.</p>
        <p><asp:Label ID="Label1" runat="server" Text="Label">This is a Label.</asp:Label></p>
        <p><asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged">This is a TextBox.</asp:TextBox></p>
        <p><asp:Button ID="Button1" runat="server" Text="This is a Button." CommandName="Button1"
            oncommand="Button_Command" onclick="Button1_Click" /></p>
        <p><asp:CheckBox ID="CheckBox1" runat="server" Text="This is a CheckBox." 
                oncheckedchanged="CheckBox1_CheckedChanged" /></p>
        <p><asp:RadioButton ID="RadioButton1" runat="server" Text="This is RadioButton #1." 
                GroupName="G1" Checked="True" oncheckedchanged="RadioButton_CheckedChanged"/>
        <asp:RadioButton ID="RadioButton2" runat="server" Text="This is RadioButton #2." 
                GroupName="G1" oncheckedchanged="RadioButton_CheckedChanged"/></p>
        <p><asp:Literal ID="Literal1" runat="server">This is a Literal.</asp:Literal></p>
        <p>The following is a <i>Table</i> which has nested <i>TableRow</i>s, which has nested <i>TableCell</i>s:<br />
        <asp:Table ID="Table1" runat="server" BorderWidth="1" GridLines="Both">
            <asp:TableRow ID="TableRow1" runat="server">
                <asp:TableCell ID="TableCell1" runat="server">
                    TableCell #1.
                </asp:TableCell>
                <asp:TableCell ID="TableCell2" runat="server">
                    TableCell #2.
                </asp:TableCell>
                <asp:TableCell ID="TableCell3" runat="server">
                    TableCell #3.
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow ID="TableRow2" runat="server">
                <asp:TableCell ID="TableCell4" runat="server">
                    TableCell #4.
                </asp:TableCell>
                <asp:TableCell ID="TableCell5" runat="server">
                    TableCell #5.
                </asp:TableCell>
                <asp:TableCell ID="TableCell6" runat="server">
                    TableCell #6.
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow ID="TableRow3" runat="server">
                <asp:TableCell ID="TableCell7" runat="server">
                    TableCell #7.
                </asp:TableCell>
                <asp:TableCell ID="TableCell8" runat="server">
                    TableCell #8.
                </asp:TableCell>
                <asp:TableCell ID="TableCell9" runat="server">
                    TableCell #9.
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table></p>
        <p><asp:Image ID="Image1" runat="server" AlternateText="This is an Image." ImageUrl="~/images/bible_light2.jpg" /></p>
        <p><asp:ImageButton ID="ImageButton1" runat="server" 
                AlternateText="This is an ImageButton." ImageUrl="~/images/windows.bmp" 
                OnClick="ImageButton1_Click1" /></p>
        <p><asp:ImageMap ID="ImageMap1" runat="server" AlternateText="This is an ImageMap." ImageUrl="~/images/testcolors.gif" OnClick="ImageMap1_Click">
            <asp:RectangleHotSpot HotSpotMode="PostBack" PostBackValue="CYAN" Left="0" Top="0" Right="49" Bottom="49" />
            <asp:RectangleHotSpot HotSpotMode="PostBack" PostBackValue="GREEN" Left="50" Top="0" Right="99" Bottom="49" />
            <asp:RectangleHotSpot HotSpotMode="PostBack" PostBackValue="BLACK" Left="0" Top="50" Right="49" Bottom="99" />
            <asp:RectangleHotSpot HotSpotMode="PostBack" PostBackValue="RED" Left="50" Top="50" Right="99" Bottom="99" />
        </asp:ImageMap></p>
        <p><asp:Calendar ID="Calendar1" runat="server" Caption="This is a Calender." 
                onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar></p>
        <p>The following is a FileUpload and a Button:<br />
        <asp:FileUpload ID="FileUpload1" runat="server"/>&nbsp;
        <asp:Button ID="Button2" runat="server" Text="Upload" CommandName="Button2" 
            oncommand="Button_Command" Height="22px" onclick="Button2_Click" /></p>
        <p><asp:Panel ID="Panel1" runat="server">
            This text and the button on the right is inside a Panel. 
            <asp:Button ID="Button3" runat="server" Text="Hide Panel" CommandName="Button3" 
                oncommand="Button_Command" OnClick="Button3_Click" />
        </asp:Panel></p>
        <p>The following is a <i>MultiView</i> which has two <i>View</i>s, and a button:<br />
        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" 
                onactiveviewchanged="MultiView1_ActiveViewChanged">
            <asp:View ID="View1" runat="server">
                This text is in View #1.
            </asp:View>
            <asp:View ID="View2" runat="server">
                This text is in View #2.
            </asp:View>
        </asp:MultiView><br />
        <asp:Button ID="Button4" runat="server" Text="Switch View" CommandName="Button4" 
                oncommand="Button_Command" onclick="Button4_Click" /></p>
        <div id="divWizard" runat="server">The following is a <i>Wizard</i> which has two <i>WizardStep</i>s:<br />
            <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" BackColor="#F7F6F3" 
                BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" 
                Font-Names="Verdana" Font-Size="0.8em" 
                onfinishbuttonclick="Wizard1_FinishButtonClick">
                <StepStyle BorderWidth="0px" ForeColor="#5D7B9D" />
                <WizardSteps>
                    <asp:WizardStep runat="server" title="Step 1">
                        This is the contents of Step 1.<br />
                        I was too lazy to add more controls here.
                    </asp:WizardStep>
                    <asp:WizardStep runat="server" title="Step 2">
                        And this is the contents of Step 2.<br />
                        I was too lazy to add more controls here too.
                    </asp:WizardStep>
                </WizardSteps>
                <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" />
                <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" 
                    BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" 
                    ForeColor="#284775" />
                <SideBarStyle BackColor="#7C6F57" BorderWidth="0px" Font-Size="0.9em" 
                    VerticalAlign="Top" />
                <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" 
                    Font-Size="0.9em" ForeColor="White" HorizontalAlign="Left" />
            </asp:Wizard>
            <br />
        </div>
    </div>
    </form>
</body>
</html>

and here is contents of the C# code-behind file:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
        }
        else
        {
        }
    }
    protected void Button_Command(object sender, CommandEventArgs e)
    {
        Response.Write("This text came from the <i>Button</i>'s shared <i>OnCommand</i> event handler.<br />");
        switch (e.CommandName)
        {
            case "Button1":
                Response.Write("You clicked on the \"" + Button1.Text + "\" button.<br /><br />");
                break;
            case "Button2":
                Response.Write("You clicked on the \"" + Button2.Text + "\" button.<br /><br />");
                if (FileUpload1.HasFile)
                {
                    FileUpload1.SaveAs(this.MapPath("~") + "\\" + FileUpload1.FileName);
                    Response.Write("You have successfully uploaded a file named \""
                        + FileUpload1.FileName + "\".<br /><br />");
                }
                break;
            case "Button3":
                Panel1.Visible = false;
                Response.Write("You clicked on the \"" + Button3.Text + "\" button.<br />"
                + "The Panel is now hidden.<br /><br />");
                break;
            case "Button4":
                Response.Write("You clicked on the \"" + Button4.Text + "\" button.<br /><br />");
                if (MultiView1.ActiveViewIndex == 0)
                    MultiView1.ActiveViewIndex = 1;
                else
                    MultiView1.ActiveViewIndex = 0;
                break;
            default:
                break;
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Response.Write("This text came from the <i>ImageButton</i>'s OnClick event handler.</br><br />");
    }
    protected void ImageMap1_Click(object sender, ImageMapEventArgs e)
    {
        Response.Write("This text came from the <i>ImageMap</i>'s event OnClick handler.<br />"
            + "You clicked on the " + e.PostBackValue + " part of the image.<br /><br />");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        // I added an OnCommand event handler to do stuff instead of this event.
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        // I added an OnCommand event handler to do stuff instead of this event.
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        // I added an OnCommand event handler to do stuff instead of this event.
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        // I added an OnCommand event handler to do stuff instead of this event.
    }
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        divWizard.Visible = false;
        Response.Write("This text came from the <i>Wazard</i>'s OnFinishButtonClick event handler.<br /><br />");
    }
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        Response.Write("This text came from the <i>TextBox</i>'s OnTextChanged event handler, because you"
            + " changed the text that was in the TextBox.<br /><br />");
            
    }
    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
        string chk =
            CheckBox1.Checked ? "checked" : "unchecked";
        Response.Write("This text came from the <i>CheckBox</i>'s OnCheckedChanged event handler.<br />"
            + "You " + chk + " the CheckBox.<br /><br />");
    }
    protected void RadioButton_CheckedChanged(object sender, EventArgs e)
    {
        string selectedRadioButton =
            RadioButton1.Checked ? "#1" : "#2";
        Response.Write("This text came from the <i>RadioButton</i>'s shared OnCheckChanged event handler.<br />"
            + "You selected RadioButton " + selectedRadioButton + ".<br /><br />");
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        Response.Write("This text came from the <i>Calendar</i>'s OnSelectionChanged event handler.<br />"
            + "You selected the following date:&nbsp; "
            + Calendar1.SelectedDate.ToShortDateString() + ".<br /><br />");
    }
    protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
    {
        string vw = MultiView1.ActiveViewIndex == 0 ? "#1" : "#2";
        Response.Write("This text came from the <i>MultiView</i>'s OnActiveViewChanged event handler.<br />"
            + "You switched to View " + vw + ".<br /><br />");
    }
    protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
    {
        Response.Write("This text came from the <i>ImageButton</i>'s OnClick event handler.<br /><br />");
    }
}

Can anyone enlighten me?

 For me Its working properly.

Hi Ledigimate,

I just tested your code, that works fine for me. Try to recreate a new application, then test the code.

Hope this helps.

Hi,

Try using the IE developer tools F12.  The do a find > Select element by click and the look at the CSS applied to various elements to try and work what is causing your problem.

 

Hope that helps.