Here's my code snippet:
protected void Page_Load(object sender, EventArgs e)
{
Page.RegisterStartupScript("SetFocus",
"<script>document.getElementById('" + txtKeyword.ClientID +
"').focus();</script>");
if (!this.txtKeyword.Text.Trim().Equals(string.Empty) )
{
DoSearch();
}
}
private void DoSearch()
{
string section = this.dpdSearchSections.SelectedValue;
string keyword = this.txtKeyword.Text;
this.txtKeyword.Text = string.Empty;
Response.Redirect("AdvancedSearch2.aspx?sec=" + section +
"&search_field_name=" + keyword);
}
So, within DoSearch(), i want to add, an a client side On Click, the
google event tracking code, as an example:
pageTracker._trackPageview('/ClickEvent/homePage/healthSearch/term=');
I want to append 'keyword' after the equals. On the asp:ImageButton i
have OnClientClick="pageTracker._trackPageview('/ClickEvent/homePage/
healthSearch/term=');" which work fine, but i'm stumped on appending
the keyword.
Thanks,
Mark.