I have a web form (Page1.aspx) in which I am passing an ID as query string to another page (Page2.aspx).
Now in this page I have EntityDataSource which binds to GridView. How should I populate this gridview with that ID?
Eg. If my ID is 1056, then in my DataGridView in Page2.aspx should populate elements of this ID.
This is the code:
protected void Page_Load(object sender, EventArgs e)
{
string getEntity = Request.QueryString["EntityID"];
int getIntEntity = Int32.Parse(getEntity);
if (getIntEntity != 0)
{
//What should I do here???
}
}
What should I do? Thank You!
See “Using a Control Parameter to Set the “Where” Property” in this tutorial:
http://www.asp.net/entity-framework/tutorials/the-entity-framework-and-aspnet-–-getting-started-part-3
The process will be similar except as “Parameter source” select QueryString instead of Control.