?
Solved

asp.net c# binding

Posted on 2007-10-19
10
Medium Priority
?
529 Views
Last Modified: 2013-11-07
I have url like default.asp?statusid=1

How can I capture above querystring statusid value to the following hyperlink? statusid=request.querystring("statusid") in asp.net?

 <asp:HyperLinkField DataNavigateUrlFields="producttypeid" DataNavigateUrlFormatString="SellerAcct_ViewTransDetails.aspx?producttypeid={0}&statusid=?"
                    DataTextField="totalproductcount" HeaderText="Total Trans Count" SortExpression="totalproductcount"
                    Text=" ">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:HyperLinkField>
             
0
Comment
Question by:riskyricky1972
  • 5
  • 4
10 Comments
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 20107207
This article from MSDN might help you out
http://msdn2.microsoft.com/en-gb/library/aa581794.aspx
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20108224
Interesting article, but I don't see how it can help here, since the value needs to come from one of the DataNavigateUrlFields.

Bob
0
 

Author Comment

by:riskyricky1972
ID: 20110332
Bob: You have any helps?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 96

Expert Comment

by:Bob Learned
ID: 20110446
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
0
 

Author Comment

by:riskyricky1972
ID: 20110788
I am in for item 1. Please show me actual code in c#. thank you
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20110814
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
0
 

Author Comment

by:riskyricky1972
ID: 20110826
Is that a way I can use inline coding?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20110835
No, since StatusID would need to be taken from a field value.

Bob
0
 

Author Comment

by:riskyricky1972
ID: 20111215
I used inline datagrid from above hyperlink. And I do not see anything that I can use your codes.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 20111415
If you add a StatusID column, and set the values as shown, then yes you can do something like this:

asp:HyperLinkField DataNavigateUrlFields="producttypeid, statusid" DataNavigateUrlFormatString="SellerAcct_ViewTransDetails.aspx?producttypeid={0}&statusid={1}"
                    DataTextField="totalproductcount" HeaderText="Total Trans Count" SortExpression="totalproductcount"
                    Text=" ">

Bob
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question