Masoud Keshavarz
Masoud Keshavarz

Reputation: 2244

Send control values between forms in asp.net

I need to send values of controls between forms in asp.net I tried to send information with following URL:

DisplayNews.aspx?cmd=HyperLink1.value

And tried to recieve information with following code:

string s = Request.QueryString["cmd"];

But in output I see "HyperLink1.value" instead of real value. Thank you for help.

Upvotes: 0

Views: 87

Answers (1)

Gregor Primar
Gregor Primar

Reputation: 6805

Try this:

        string url = "DisplayNews.aspx?cmd=" + HyperLink1.Text;
        Response.Redirect(url, false);

You can set your HyperLink1.NavigateUrl like this:

        HyperLink1.NavigateUrl = "DisplayNews.aspx?cmd=" + HyperLink1.Text;

Upvotes: 2

Related Questions