Reputation: 4261
i have url like this : DossierSoin_Fiche.aspx?SoinId=1
how can i pass this SoinId into dx:ASPxPopupControl
<dx:ASPxPopupControl ID="ASPxPopupControl_Surveill"
?
ContentUrl="~/PopUp/Surveillance.aspx?SoinId=<%=SoinId %>"
thanks you in advance
PS : i can not use code behinde, because it will reload the page, then i will lost the data that have not save in database. I use callback instead, so i need pass this querystring value on aspx not in aspx.cs
Upvotes: 0
Views: 1896
Reputation: 6638
make a property "SoinID" (if you dont already have one)
protected string SoinId {get;set;}
(type of modifier is up to the OP, could also be public
).
then, assign a value to the property in your page_load
:
SoinId = Request.QueryString["SoinID"];
your .aspx code can stay the same if you use it like this.
Upvotes: 1
Reputation: 10515
In your containers codebehind:
protected string SoinId
{
get
{
return Request["SoinId"];
}
}
And use the code you have.
Upvotes: 1
Reputation: 20364
I would imagine you could just assign the value in the code behind.
e.g.;
ASPxPopupControl_Surveill.ContentUrl = "~/PopUp/Surveillance.aspx?SoinId=" + Request["SoinId"].ToString();
Upvotes: 0
Reputation: 1739
Option A:
1) Declare a protected variable named SoinId in the scope of your aspx page.
2) In the Page_Load event, add this:
if(!Request.QueryString["SoinId"]==null)
{
SoinId = Request.QueryString["SoinId"];
}
Opetion B:
Replace your aspx code with this:
<dx:ASPxPopupControl ID="ASPxPopupControl_Surveill"
ContentUrl="~/PopUp/Surveillance.aspx?SoinId=<%=Request.QueryString["SoinId"] %>">
Edit: Consider using a property as other colleagues proposed. It's more ellegant.
Upvotes: 0
Reputation: 12988
Just pass the value to the public property in the CodeBehind of the page.
ASPxPopupControl_Surveill.ContentUrl = ...
[edit made with thanks to rs.]
Upvotes: 0