Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetch PostBack data with Request.Form? 1

Status
Not open for further replies.

ChrisBrunner

Programmer
Dec 16, 2004
7
US
__doPostBack('dgrdOutput:_ctl1:_ctl1','') is one of the javascript functions on my page. Can I use Request.Form to retrieve this? If not, is there another way? I'm just trying to use the "_ctl1:_ctl1" part in my script.

Thanks alot in advance.
 
Sorry, I didn't state my question very clearly. I have a datagrid on my page that's bound to some data. JavaScript postback functions like the one above are generated by IIS. I'm looking for a way to read the data being posted back (dgrdOutput:_ctl1:_ctl1" in this case) so I can parse it and use it in my script.

I hope that makes more sense.

Again, thanks in advance!
 
But why do you need to? You can use your own JavaScript functions to iterate through the entire DOM. The _PostBack function is just used to wrap up the controls and "events", submit them to the server, which unravels them into server side events.

Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Obviously, I know almost nothing about ASP.NET. All I need is the name of the column header that was clicked. I have to use AutoGenerateColumns and can't define the columns in advance. So, I thought if I could read all of the POST variables, I could parse the "1" out of "dgrdOutput:_ctl1:_ctl1" and use dgrdOutput.Columns.HeaderText.ToString() to get the name of the header. Do you know of an easier way to get the name of the header that was clicked?
 
Do you still need help with that sorting thing?
 
The DataGrid OnSortCommand event handler will give you the name of the column that was clicked:
Code:
private void DataGrid1_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
	{
		string currentSortColumn = e.SortExpression;
	}
 
Yes, that's what I'm still working on. =/ Is there not a simple variable that represents what header the user clicked on to sort? Or an easy way to create one?

My script reads a query from a DB table, executes it, and then displays the data using the datagrid. AFAIK, in order to make the sort function work, I need to modify the SQL query according to what the user clicked on, but in order to do that, I need to know what header the user clicked. Any ideas?

Thanks for all your help.
 
Whoops, I didn't refresh before posting that last comment. I think Veep said exactly what I needed. Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top