riskyricky1972
asked on
asp.net c# binding
I have url like default.asp?statusid=1
How can I capture above querystring statusid value to the following hyperlink? statusid=request.querystri ng("status id") in asp.net?
<asp:HyperLinkField DataNavigateUrlFields="pro ducttypeid " DataNavigateUrlFormatStrin g="SellerA cct_ViewTr ansDetails .aspx?prod ucttypeid= {0}&status id=?"
DataTextField="totalproduc tcount" HeaderText="Total Trans Count" SortExpression="totalprodu ctcount"
Text=" ">
<ItemStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
How can I capture above querystring statusid value to the following hyperlink? statusid=request.querystri
<asp:HyperLinkField DataNavigateUrlFields="pro
DataTextField="totalproduc
Text=" ">
<ItemStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
Interesting article, but I don't see how it can help here, since the value needs to come from one of the DataNavigateUrlFields.
Bob
Bob
ASKER
Bob: You have any helps?
1) If you are bound to a DataTable, then just add a column to the DataTable, and set the column value.
2) Store the QueryString value in a Session, and retrieve from the Session variable in the target page.
Bob
2) Store the QueryString value in a Session, and retrieve from the Session variable in the target page.
Bob
ASKER
I am in for item 1. Please show me actual code in c#. thank you
DataTable dt = this.DataSet1.Tables[0];
dt.Columns.Add("StatusID", typeof(int));
int statusID = (int)Request.QueryString[" StatusID"] ;
foreach (DataRow dr in dt.Rows)
dr["StatusID"] = statusID;
dt.AcceptChanges();
Bob
dt.Columns.Add("StatusID",
int statusID = (int)Request.QueryString["
foreach (DataRow dr in dt.Rows)
dr["StatusID"] = statusID;
dt.AcceptChanges();
Bob
ASKER
Is that a way I can use inline coding?
No, since StatusID would need to be taken from a field value.
Bob
Bob
ASKER
I used inline datagrid from above hyperlink. And I do not see anything that I can use your codes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://msdn2.microsoft.com/en-gb/library/aa581794.aspx