In Investor.aspx page, the DataList1 is binded. The DataList1 has UserControl that get parameter "DistId" which is used for futher when I click on hlOpenDoc.
Because I can't set "onclick" attribute to HyperLink, that would be procceeded on server, I created hidden button "
btnSetEvent " that is clicked from javascript.
At this moment "
btnSetEvent" is vissible only for the purpose of understanding my porblm.
The problem:
When I click on hlOpenDoc(that is in UserControl) I noticed that hfDistID has the same DistId regardless on which row I click the button
hlOpenDoc.
But when I click on
"btnSetEvent" the hfDistID control has correct value that depends on which row I clicked.
Why it is happens?
Thank you.

Investor.aspx
"DataList1" runat="server" CellSpacing="4" Width="545px" DataSourceID="SqlHanpakot">
"LightGray" BorderColor="Transparent" Height="20px" />
"Transparent" BorderColor="Transparent" />

"width: 100%">



"width: 55px; height: 38px; background-position: center center; text-align: center;">
"OpenDoc1" runat="server"/>


<

user control(OpenDoc.ascx)
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="OpenDoc.ascx.cs" Inherits="OpenDoc" %>

"hlOpenDoc" runat="server"
Font-Names="Arial"
Font-Size="10pt"
Font-Underline="False"
ForeColor="Green"
Width="93px"
Target="_blank"
onclick="setEvent();">Open document


"hfDistID" runat="server" />
"UpdatePanel1" runat="server">

"btnSetEvent" runat="server"
Text="Button"
onclick="btnSetEvent_Click"/>


code behind(OpenDoc.ascx.cs)
public partial class OpenDoc : System.Web.UI.UserControl
{
public string NavigateUrl
{
set
{
hlOpenDoc.NavigateUrl = value;
}
}

public string DistID
{
set
{
hfDistID.Value = value;
}
}

protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnSetEvent_Click(object sender, EventArgs e)
{

}
}