0

Im passing a query string from 1 page to many pages, the second page accepts the query string and pass it to the next page and so on. On the second page i accept the query string and it appear's on the url bar, that shows that the second page can recieve the query string. The problem is i want to send it to business class like this

CD = new BusinessLayer.ContactDetails(Convert.ToInt32(Request.QueryString["txtAlumnus.Text"], "CD12354", txtCell.Text, txtTellHome.Text, txtTellWork.Text, txtEmail.Text, txtPAddress.Text, txtPCode.Text, txtRCode.Text, txtRAddress.Text);

and the business class seems like it cant recieve it at all.
Another problem i have is, as i accept on the second page and send it on the third page, now the third page on the url bar shows 0, meaning it cant recieve any value.

Need some advice, your response will be appreciated

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by sknake
0

First -- This is more of an ASP.NET question than C# and should be posted in the ASP.NET forum. A moderate will move it for you so please don't create a new thread.

Second -- You should consider marking your threads solved as you find answers for them. Eventually people will stop helping you out if you never mark a thread solved.

Last -- You need to make a concious effort to pass the query string along when you redirect to the next page. Take this as an example:

public partial class frmDevex : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
      string rawQuery = Request.QueryString.ToString();
      if (!string.IsNullOrEmpty(rawQuery))
        rawQuery = "?" + rawQuery;
      Response.Redirect(@"/frmDevex2.aspx" + rawQuery);
    }
  }
namespace daniweb.web
{
  public partial class frmDevex2 : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
      string rawQuery = Request.QueryString.ToString();
      if (!string.IsNullOrEmpty(rawQuery))
        rawQuery = "?" + rawQuery;
      Response.Redirect(@"/frmDevex.aspx" + rawQuery);
    }
  }
}

These two pages call eachother back and forth and pass on the query string so it is not lost. This is likely the reason you're not receiving the value in your BLL.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.