?
Solved

How do I pass querystring from the detailsview update?

Posted on 2010-11-08
2
Medium Priority
?
451 Views
Last Modified: 2012-05-10
Dear Experts,

I have this DetailsView with ShowEditButton set to true. When user click Update, I need to pass a querystring from inside the EditItemTemplate, the value of the querystring should be from one of the dropdown selectedvalue. How can I do that?
Thanks,
Dan
0
Comment
Question by:luisr69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 34095402
You want to pass querystring to what?
You can definitely grab the value of dropdown something like this in the DV ItemUpdating event that is fired when you click the Update button:

protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        DropDownList ddl = (DropDownList )DetailsView1.FindControl("DropDownList 1");
        string value = ddl.SelectedValue;

       //OR try getting new value using correct index / name of your ddl field
        string newvalue = e.NewValues[1].ToString();

       //you can use this value to pass it to querystring
    }
0
 

Author Comment

by:luisr69
ID: 34096148
I use this:

protected void DetailsViewAuditEdit_ItemUpdated(Object sender, System.Web.UI.WebControls.DetailsViewUpdatedEventArgs e)
    {
        DropDownList ddl = (DropDownList)DetailsViewAuditEdit.FindControl("lstBranch");
        string value = ddl.SelectedValue;
        //pass the query string
     }

And it works. That's what I was looking for. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

752 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