Pass multiple values into a webservice for a popup control extender
<p>I am trying to pass multiple values from a gridview template using an ajax popupcontrol extender.  I can get it to work when I just pass the primary key, my problem is I need to pass the primarykey and form type.  Here is my latest attempt at the code:</p>

<p>Gridview template field</p>

<pre><code>   &lt;asp:TemplateField&gt;
  &lt;HeaderStyle VerticalAlign="Top" BorderWidth="0"/&gt;
  &lt;ItemStyle BorderWidth="0"/&gt;
  &lt;ItemTemplate&gt;
  &lt;asp:Image runat="server" BorderStyle="None" ID="Image1" ImageUrl="~/Images/MagnifyingClass.gif" /&gt;
    &lt;cc1:PopupControlExtender ID="PopupControlExtender1" runat="server" 
        PopupControlID="Panel1" 
        TargetControlID="Image1" 
        DynamicContextKey='&lt;%# Eval("Pkey") %&gt;+","+&lt;%# Eval("RequestType") %&gt;' 
        DynamicControlID="Panel1" 
        DynamicServiceMethod="GetRequest" Position="right"&gt; 
    &lt;/cc1:PopupControlExtender&gt; 
    &lt;asp:Panel ID="Panel1" runat="server"&gt;&lt;/asp:Panel&gt;                
 &lt;/ItemTemplate&gt;
 &lt;ItemStyle HorizontalAlign="Center" /&gt;
</code></pre>

<p></p>

<p>Code Behind</p>

<pre><code>    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated

    'If Datarow exists then create hyperlink
    If e.Row.RowType = DataControlRowType.DataRow Then

        If Not e.Row.DataItem Is Nothing Then

            Dim myPkey As String = e.Row.DataItem("Pkey") &amp; "," &amp; e.Row.DataItem("RequestType")
            Dim pce As PopupControlExtender = TryCast(e.Row.FindControl("PopupControlExtender1"), PopupControlExtender)

            pce.BehaviorID = myPkey

            Dim img As Image = DirectCast(e.Row.FindControl("Image1"), Image)

            Dim OnMouseOverScript As String = String.Format("$find('{0}').showPopup();", myPkey)
            Dim OnMouseOutScript As String = String.Format("$find('{0}').hidePopup();", myPkey)

            img.Attributes.Add("onmouseover", OnMouseOverScript)
            img.Attributes.Add("onmouseout", OnMouseOutScript)

        End If

    End If

End Sub
</code></pre>

<p>Web Service</p>

<pre><code>    &lt;System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()&gt; _
Public Shared Function GetRequest(ByVal contextKey As String) As String

    Dim strSQL As String
    Dim objData As clsDataAccess = New clsDataAccess()
    Dim ds As New DataSet

    Dim parts As String() = contextKey.Split(",")
    Dim ThePkey As Integer = CInt(Trim(parts(0)))

    strSQL = "Select * from tblExpenseElement Where Pkey = " + ThePkey 

    ds = objData.SQLExecuteDataset(strSQL, CommandType.Text)

    Dim t1 As DataTable
    t1 = ds.Tables(0)

    Dim b As New StringBuilder()

    b.Append("&lt;table style='background-color:#f3f3f3; border: #336699 3px solid; ")
    b.Append("width:450px; font-size:10pt; font-family:Arial;' cellspacing='1' cellpadding='3'&gt;")
    b.Append("&lt;tr&gt;&lt;td align='left' style='background-color:gray; color:black;'&gt;")
    b.Append("&lt;b&gt;Request Description&lt;/b&gt;")
    b.Append("&lt;/td&gt;&lt;/tr&gt;")
    b.Append("&lt;tr&gt;")
    b.Append("&lt;td align='left'&gt;" &amp; t1.Rows(0).Item("DescribeRequest") &amp; "&lt;/td&gt;")
    b.Append("&lt;/tr&gt;")
    b.Append("&lt;/table&gt;")

    Return b.ToString()

End Function
</code></pre>
