i am trying to access a query string value from .cs page to aspx page but cann't bcz i am retrieving it within Page_load function , so its been local to this event and cannot be accessed outside so what to do ?


protected void Page_Load(object sender, EventArgs e)


        String employerEmail = Request.QueryString["employerEmail"];

and then after retrieving query string value i want to integrate it into this hyperlink , see BOLDED part, email, here i want to put querystring value

<asp:HyperLink ID="homeBtnImage" runat="server" ImageUrl="~/btnPayPal.gif"
          NavigateUrl= "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_xclick&business=smile2_1355775057_biz@yahoo.com&item_name=MemberShip&amount=20┬Ący=USD&return='?' &cancel_return=https://www.google.com/" >PayPal</asp:HyperLink> 

A better approach may be to access the NavigateUrl property in the code behind and append tbe query string value there. For example..

homeBtnImage.NavigateUrl = "somehost.domain.com/page.aspx?q=" & employerEmail

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.