?
Solved

Postback to a gridview on a button click

Posted on 2008-11-03
1
Medium Priority
?
871 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
[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
1 Comment
 
LVL 4

Accepted Solution

by:
Makolyte earned 200 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

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

771 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