Solved

Postback to a gridview on a button click

Posted on 2008-11-03
1
856 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Redacting a row in Excel based on a term. 17 54
Memory Usage 2 50
Host asp.net pages 5 25
Javascript and Jquery not firing 9 42
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

867 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

21 Experts available now in Live!

Get 1:1 Help Now