How to manage the redirect in a custom page (Asp.Net/C#)?

Hello, I have a custom page (Asp.Net/C#) displays a GridView with data (it's a custom grid that is the same as a Sage grid).

In this GridView, I created a column with hyperkinks.

I would like to know how to build the url?

When I click in the gridview data, I have this url : http://backup2/CRM/eware.dll/Do?SID=11533264432680&Act=200&Mode=1&CLk=T&Key-1=58&Key0=1&Key1=3927&Key2=3

But on the Sage Crm grid, I have this url : http://backup2/CRM/eware.dll/Do?SID=13845882140818&Act=200&Mode=1&CLk=T&Key-1=58&Key0=1&Key1=3927&Key2=3

The SID changes.

Do you have an idea or a better solution?

Thanks.

  • 0

    Hi,

    There should not be a scenario that SID changes while navigation from grid to another screen or grid unless it is hardcoded into your .NET code. I assume you have used Hyperlink to option which is available in the list/grid to add hyperlink on column.

    It would be great if you can post code that you have written or settings that you have done to add hyperlink on columns so that we will assist you better.

    Sincerely,

    Dinesh

  • 0

    Thanks for reply.

    I add the url (for the third column = e.Row.Cells[2] ) on the RowDataBound event of my GridView.

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

    {

    if (e.Row.RowType == DataControlRowType.DataRow)

    {

    string HyperLinkValue = "">backup2/.../Do + e.Row.Cells[9].Text + "&Key2=3";

    e.Row.Cells[2].Controls.Add(new HyperLink { NavigateUrl = HyperLinkValue, Text = e.Row.Cells[2].Text, ForeColor = System.Drawing.Color.Blue });

    }

    }

  • 0

    Hi Jayce,

    Looking at the URL that you had built I noticed that you have hardcoded SID value. That’s the reason you are getting different SID value. You have to fetch the SID value through Query string method. Below is the syntax of the same.

    Request.QueryString["SID"];

    HTH!

    Regards,

    Dinesh