mcrmg
asked on
Empty String
Hi,
I am using GridView in C#
I am trying to pass email to a javascript
But the string always returns empty, it works when passing the int. Any ideas? thanks
I am using GridView in C#
<asp:LinkButton ID="LinkButton5" CommandArgument='<%# Eval("EmailAddress") %>' CommandName="LinkEmail" runat="server" Visible="true" HeaderStyle-Width="10%"><%#Eval("EmailAddress")%></asp:LinkButton>
I am trying to pass email to a javascript
protected void recordListContact_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "LinkEmail")
{
string EmailAddress = e.CommandArgument.ToString();
ScriptManager.RegisterStartupScript(this, GetType(), "myFunction", "SendEmail(" + EmailAddress + ");", true);
}
}
But the string always returns empty, it works when passing the int. Any ideas? thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No worries, glad to help.
ASKER