Click here to Skip to main content
15,886,012 members

403 error: how do you code more than one hyperlink to trigger popupextender

Member 9445358 asked:

Open original thread
I am trying to make several hyperlinks be the target control of a popupcontrolextender. Right now the hyperlink1 triggers everything correctly, but i need to have the panel1 and panel2 popup, with data dynamically filled, for the other links as well. Here is the code:
<asp:Panel ID="Panel3" runat="server">
    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional" >
    <ContentTemplate>
 <asp:LinkButton ID="LinkButton1" CssClass="calendar" onmouseover="$find(this).showPopup();" 
                    onmouseout="$find(this).hidePopup();" onClick="LinkButton1_Click" value="LinkButton6"
                rel="nofollow" runat="server">hi</asp:LinkButton>
                <asp:LinkButton ID="LinkButton60"  onmouseover="$find(this).showPopup();" 
                    onmouseout="$find(this).hidePopup();" onClick="LinkButton1_Click" value="LinkButton6" 
                    runat="server">LinkButton</asp:LinkButton>
                <asp:LinkButton ID="LinkButton120"  onmouseover="$find('this').showPopup();" 
                    onmouseout="$find(this).hidePopup();" onClick="LinkButton1_Click" value="LinkButton12" 
                    runat="server">LinkButton12</asp:LinkButton>
//many more links....
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:Panel ID="Panel1" CssClass="popup" runat="server">
        <Triggers>
                <asp:AsyncPostBackTrigger ControlID="LinkButton60" EventName="click" />
        <asp:AsyncPostBackTrigger ControlID="LinkButton120" EventName="click"/>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                Event:
                <asp:Literal ID="Literal1" runat="server"></asp:Literal><br />
                Time:
                <asp:Literal ID="Literal2" runat="server"></asp:Literal><br />
                Location:
                <asp:Literal ID="Literal3" runat="server"></asp:Literal><br />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
     <asp:BalloonPopupExtender ID="BalloonPopupExtender1" BalloonPopupControlID="Panel1"
        Position="TopRight" TargetControlID="LinkButton60" runat="server" BalloonSize="Medium"
        DisplayOnMouseOver="True" DynamicContextKey="value" DynamicControlID="Panel1" DynamicServicePath="DynamicPopulate.asmx.cs"
        DynamicServiceMethod="UpdatePanel1_DynamicPopulateExtender">
    </asp:BalloonPopupExtender>
    <asp:Panel ID="Panel2" runat="server" CssClass="popup">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
            <asp:Image ID="Image1" Style="height: auto;" ImageUrl="imagename.jpg" 
                AlternateText="Comedy Masque Review"
                BorderColor="green" BorderStyle="Ridge" BorderWidth="6px" 
                runat="server" Width="300px" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>
<asp:PopupControlExtender ID="PopupControlExtender1" runat="server" Position="Bottom" 
    DynamicContextKey="value" DynamicControlID="Panel2" 
    DynamicServiceMethod="PlaceHolder1_DynamicPopulateExtender" DynamicServicePath="DynamicPopulate.asmx.cs" 
    BehaviorID="onclick" PopupControlID="Panel2" TargetControlID="LinkButton60" CommitProperty="value" CommitScript="onOK();"></asp:PopupControlExtender>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>

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

namespace something
{
    /// <summary>
    /// Summary description for DynamicPopulate
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
     [System.Web.Script.Services.ScriptService]
    public class DynamicPopulate : System.Web.Services.WebService
    {

        [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
        public string PlaceHolder1_DynamicPopulateExtender(string contextKey)
        {
            string s = "got to service method";

            return s;
        }
        [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
        public  string UpdatePanel1_DynamicPopulateExtender(string contextKey)
        {
            string s = "got to service method";

            return s;

        }
    }
}


CAN'T get into service method call failed: 403(Forbidden). (Although use successfully SlideService WebService in same project)
Did search on internet, and thought i needed to add proxy to config file, but must not be doing it correctly:
I am using an IIS local host:
 http://localhost:50867/RoutingName<pre>
and must not be modifying the code below correctly!  Can you help?
<configuration>
  <system.net>
    <defaultproxy>
      <proxy>
        usesystemdefaults="true"
        proxyaddress="http://192.168.1.10:3128"
        bypassonlocal="true"
      />
      <bypasslist>
        <add address="[a-z]+\.contoso\.com" />
      </bypasslist>
    </proxy></defaultproxy>
  </system.net>
</configuration>
Tags: .NET (.NET4), Ajax

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900