views:

944

answers:

2

HI, I have a HyperLink column in a gridview that when clicked should navigate the user to another page. I pass parameters to the page using a querystring. I am implemeting this action in the grid's onrowdatabound event. here is the code:

            HyperLink btnDetails = (HyperLink)ea.Row.FindControl("btnDetails");
            btnDetails.NavigateUrl = "ManageFlaggedSecurities.aspx?portfolioID=" + obPortfolioId.ToString() + "&testID=" + obTstId.ToString();

I can set a breakpoint in my page_load event of the ManageFlaggedSecurities page but when I want to check the values of some string parameters i set I get 'does not exist in the current context' on the variables. I even tried something simple like

string strTest = "testing";

and got the error. What am I doing wrong?

Mike

A: 

It sounds like you are trying to access variables declared inside the event handler while having a break point on Page_Load, hence having them out of scope, or trying to access variables that were declared in the caller up the stack.

Show some code...

Ruslan
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strPortID = "testing 1"; string strTestID = "testing 2";
MikeD
Well this looks normal. And you are saying that if you set a break point on strPortID = "testing 1", it stops there, but the debugger won't show its value in the watch or quick view?
Ruslan
I think you are right about breaking in page_load and trying to view local vars defined in page_load in the immediate window. Codes working fine - I just can't debug at that point.
MikeD