Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Beginners question

Thread Tools

Beginners question

tsaprout tsaprout is offline
Junior Member
Join Date: Jun 2008
Posts: 7
I have the following code:

public partial class _Default : System.Web.UI.Page

String sql2 = "";
DataSet ds;

protected void Button1_Click(object sender, EventArgs e)
if (Page.IsValid)
QueryCommand smd = new QueryCommand(sql2);<- HERE sql2 isNOT NULL
ds = DataService.GetDataSet(smd); <- HERE ds isNOT NULL
GridView1.DataSource = ds;

protected void GridView1_Sorting1(object sender, GridViewSortEventArgs e)
QueryCommand smd = new QueryCommand(sql2); <- HERE sql2 is NULL
ds = DataService.GetDataSet(smd); <- HERE ds is NULL

Question: How can I get the values of the variables from Button_Click so I can use them in GridView1_Sorting1 method?

Please help me I feel totally lost.

Thank you in advance.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginners Question CHAZDG Wireless Networking 2 11-10-2005 12:29 AM
Beginners Question Regarding Static Web Pages Roger stevenson ASP .Net 8 07-01-2005 04:05 AM
Stupid beginners question: Windows Username Child ASP .Net 2 06-01-2005 08:03 PM
web service beginners question Mike P ASP .Net 3 09-21-2004 01:50 PM
Beginners question about DataGrid and page selection Alex ASP .Net 1 04-19-2004 08:36 PM