Solved

Postback to a gridview on a button click

Posted on 2008-11-03
1
855 Views
Last Modified: 2013-12-17
I've been asked to develop a system to record holiday requests.  I'm completely new to asp.net  so I'm finding it a bit of a struggle.  

At the moment I have a form with two dropdownlists and two text boxes and a button.  The users clicks fills in the form and presses the button and it runs a stored procedure to insert the details into my database.  

What I'm struggling to do or find much information is how to use the information from the controls on the form and populate gridview on the button click.  

Thanks in advance

Dave
0
Comment
Question by:leap29
1 Comment
 
LVL 4

Accepted Solution

by:
Makolyte earned 50 total points
ID: 22868091
What I think you're saying is:
1. You want to read the properties of the controls and write them to your database
2. Show an updated GridView

DropDownList value: dropdownlistname.SelectedItem.Value
TextBox value: textboxname.Text

Next if you want to update the GridView the lazy way, you can just rebind it like this:
dataSourceName = callYourSP()
gridViewName.DataSource = dataSourceName
gridViewName.DataBind()

If you have a small amount of records the lazy way is fine.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now