Link to home
Start Free TrialLog in
Avatar of mcrmg
mcrmg

asked on

Empty String

Hi,
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>

Open in new window


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);
            

        }

    }

Open in new window


But the string always returns empty, it works when passing the int. Any ideas? thanks
ASKER CERTIFIED SOLUTION
Avatar of Dustin Saunders
Dustin Saunders
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mcrmg
mcrmg

ASKER

that's it...............thank you very much.......
No worries, glad to help.